Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native-datetimepicker Change Text Color

Issue

I need to change the color of the text displayed in the picker for react-native-datetimepicker as I have a very dark background and the text is extremely hard to see on it.

What I've Tried

I've tried passing in color: 'white' as a style to the DateTimePicker component and I've also tried passing in the itemStyle prop to the DateTimePicker component as that is how you change text styles on react-native's Picker component. Neither have worked.

Does anyone know how to change the text style in react-native-datetimepicker?

Example

Example

like image 260
bzlight Avatar asked Apr 21 '26 16:04

bzlight


2 Answers

You have the property textColor available:

<DateTimePicker 
...
textColor="white" />
like image 187
Max Becerra Avatar answered Apr 24 '26 06:04

Max Becerra


If you are using expo, you must go to node_modules/react-native-date-picker/style.js folder and use this:

dateText: {
    color: '#fff'
},
like image 35
Emmanuel Del Samos Avatar answered Apr 24 '26 06:04

Emmanuel Del Samos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!