question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker in IOS is not working in dark mode

See original GitHub issue

Issue

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

daepicker

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

  1. react : 16.8.3
  2. react-native : 0.59.8
  3. react-native-datepicker : 1.7.2
  4. target platform: IOS
  5. operating 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:22

github_iconTop GitHub Comments

57reactions
Mohammad-Khalid23commented, Oct 21, 2019

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

6reactions
manojalwisnzcommented, Oct 21, 2019

@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. IMG_0487

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found