reactjs - iOS DatePicker 在 React Native 中不显示
问题描述
我在 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>
推荐阅读
- angular - Angular 11 - 订阅不返回响应类型文本的正确数据
- javascript - React hook,更新后直接访问状态值
- python - 如何使用 Tkinter 将多个 Dataframes 导出到多个 Excel 工作表?
- swift - 使用 URLSession.shared.dataTask Data Swift 解密 CommonCrypto 总是返回 nil
- c# - 不执行方法释放锁
- javascript - 如何在 nodeJS API 中自动化我的发布请求?
- tclsh - tclsh 相当于 bash 的 -c(运行命令)是什么?
- javascript - 如何使用 javascript vanilla 将数组与另一个元素进行比较
- netlogo - Netlogo - 为什么“if”语句被忽略?
- bash - 如何找到我使用 curl 命令下载的空文件?