DatePicker in IOS shows blank view
See original GitHub issueIssue
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
react-native -v
:0.59.10node -v
: 10.15.0npm -v
: 6.4.1yarn --version
:target platform
: IOS
Here is a screenshot:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:9
Top 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 >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
My issue relates to this issue: https://github.com/xgfe/react-native-datepicker/issues/375
The solution is:
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', }, }} />