我在 iOS 上看不到我的 DatePicker。模态已打开,但看不到任何东西,当我将 DatePicker 移入模态时,日期会发生变化,因此我知道它可以正常工作。它只是看不见,我不知道为什么。
你能帮忙吗?
谢谢
type Props = {
date: Date,
updateDate: Function
}
type State = {
}
export class DatePickerComponent extends React.Component<Props, State> {
constructor(Props: Object) {
super(Props);
}
render() {
return (
<DatePicker
cancelBtnText="Annuler"
confirmBtnText="Valider"
customStyles={{
dateIcon: {
position: 'absolute',
left: 5,
marginLeft: 0
},
dateInput: {
marginLeft: 45
}
}}
date={this.props.date}
format="DD-MM-YYYY"
iconSource={require("../../assets/Birthday.png")}
locale="fr"
onDateChange={(date) => this.props.updateDate(date)}
style={{width: "60%", marginTop: 15}}
/>
);
}
}
最佳答案
1.打开Info.plist。 2.添加这些:
<key>UIUserInterfaceStyle</key>
<string>Light</string>
关于reactjs - iOS DatePicker 在 React Native 中不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58087181/