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 shows blank view

See original GitHub issue

Issue

DatePicker in IOS shows blank view

Expected Behavior

Users can see date picker

Code

  <DatePicker
                        style={styles.birthdayInput}
                        date={this.state.birthday}
                        ref={dateRef => this.dateRef = dateRef}
                        mode="date"
                        placeholder="Birthday"
                        format="MM-DD-YYYY"
                        androidMode="spinner"
                        onCloseModal={this.onBirthdaySubmitted}
                       // maxDate={moment().format('MM-DD-YYYY')}
                        confirmBtnText="Next"
                        cancelBtnText="Cancel"
                        customStyles={{
                        dateIcon: {
                                width: 0,
                                height: 0,
                            },
                        dateInput: {
                        color: 'grey',
                        alignItems: 'center',
                        },
                        placeholderText: {
                            color: '#AAAAAA',
                            fontSize: Platform.OS === 'android'? 23 : 22,
                            textAlign: 'left',
                            zIndex: 101,
                            fontWeight: Platform.OS === 'android' ? '200' : '200',
                            fontFamily: 'JosefinSans-Regular',
                            paddingLeft: 5,
                            marginTop: 12,
                        },
                        dateInput: {
                            borderWidth: 0,
                            alignItems: 'flex-start',
                        },
                        dateTouchBody: {
                            alignItems: 'flex-start',
                        },
                        dateText: {
                            fontSize: 22,
                            fontFamily: 'JosefinSans-Regular',
                            zIndex: 101,
                            color: 'black',
                            marginTop: 10,
                            paddingLeft: 5,
                        }
                        }}
                        onDateChange={(date) => this.onChangeBirthday(date)}
                        allowFontScaling={false}
                    />

Environment

  1. react-native -v:0.59.10
  2. node -v: 10.15.0
  3. npm -v: 6.4.1
  4. yarn --version:
  5. target platform: IOS

Here is a screenshot:

Screen Shot 2019-10-21 at 15 31 09

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:9

github_iconTop GitHub Comments

54reactions
Luckygirlllllcommented, Oct 21, 2019

My issue relates to this issue: https://github.com/xgfe/react-native-datepicker/issues/375

The solution is:

<key>UIUserInterfaceStyle</key>
<string>Light</string>
21reactions
jacobjohn90commented, Nov 6, 2019

FOR EXPO USERS: Is your phone in dark mode? If it is, then the text color is actually white but the background didn’t change. I had to use their customstyles prop named datePickerCon with a background-color that changes depending on if the device is iOS and is in darkmode using Appearance API https://docs.expo.io/versions/latest/sdk/appearance/

<DatePicker ... customStyles={{ ... datePickerCon: { backgroundColor: 'black', }, }} />

Read more comments on GitHub >

github_iconTop Results From Across the Web

Only the current date is displayed blank in UIDatePicker.
Only the current date is displayed blank in UIDatePicker, is there a way to display it normally? (It does not occur in the...
Read more >
UIDatePicker Shows Empty Picker view - ios - Stack Overflow
Finally I figure out it. It was a issue of one third party library called UIHidingView!! It was added by someone in this...
Read more >
Need help asap with datepicker default value
Hello! I have a field in my powerapps where you can choose a date/time and its not mandatory. For about 1 year it...
Read more >
The best date pickers for your React Native app
Choosing the right library for a React Native date picker ... React Native DateTimePicker is implemented in accordance with iOS and Android ...
Read more >
Date & Time Picker Dialog Tutorial in React Native ... - YouTube
In this video we'll be looking at how we can create a Date Picker and a Time Picker in React Native in less...
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