Datepicker in IOS is not working in dark mode
See original GitHub issueIssue
I am using react-native-picker , on android its working fine but on IOS ( iphone XS ,iphone XS max, iphone 11, iphone 11 pro , iphone 11 pro max) is not showing the calendar properly in the below image , in datepicker date is not showing and sometime month scroll is also not working.
I also used react-native DatepickerIOS it’s showing same behavior like the attached image
Code
<DatePicker
style={{ height: 30, marginTop: -10 }}
date={this.state.noteData.date ? this.state.noteData.date : new Date()}
mode="date"
format="YYYY-MM-DD"
confirmBtnText="Confirm"
cancelBtnText="Cancel"
maxDate={new Date()}
customStyles={{
dateInput: {
borderColor: 'transparent',
backgroundColor: 'transparent',
height: 20,
alignItems: 'flex-start',
paddingLeft: 7
},
dateText: styles.inputBox,
placeholderText: styles.inputBox
}}
showIcon={false}
onDateChange={(date) => this.handleChange(date, 'date')}
/>
Environment
react
: 16.8.3react-native
: 0.59.8react-native-datepicker
: 1.7.2target platform
: IOSoperating system
: ubunto
If someone faced this issue kindly help how can I fixed this , this is happening only iphone series after iphone X like I mentioned above
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:22
Top Results From Across the Web
How to override iOS dark mode style for datepicker
The problem was that I couldn't override the color of the Datepicker. I was also not able to override the background color of...
Read more >SOLVED: .preferredColorScheme() not affecting DatePicker ...
I am implementing in my app a (pretty standard) feature to allow the user to force light or dark mode. However, I noticed...
Read more >Inline or compact UIDatePicker with white tint color
Yes, with a non white tint color the problem does not appear. The problem is only when the tint color is white and...
Read more >react-native-community/datetimepicker - npm
themeVariant ( optional , iOS only ) ... Allows overriding system theme variant (dark or light mode) used by the date picker. However,...
Read more >Native Mobile Date Picker Issue - Mendix Forum
color, }, Problem with doing that is if a user has Dark Mode enabled for iOS they see this: They see this even...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found this to resolve the issue, Add this to your info.plist file:
<key>UIUserInterfaceStyle</key>
<string>Light</string>
hope it will work for you
@Mohammad-Khalid23 , Hi There, i have same issue with new iOS version and calendar doesn’t appear properly . Please, somebody give a quick solution for this.