reactjs - iOS DatePicker 在 React Native 中不显示

标签 reactjs react-native datepicker

我在 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/

相关文章:

reactjs - 解析错误 : JSX value should be either an expression or a quoted JSX text

reactjs - 将firebase存储文件下载到计算机

javascript - 如何编写多个组件

javascript - react Stripe 元素错误 : You must provide a Stripe Element or a valid token type to create a Token

javascript - 无法读取未定义 ReactJS 的属性 'setState'

react-native - 有没有办法在 React Native 中使用字体功能设置

react-native - react 具有比例依赖性的 native 动画旋转圆

javascript - jQuery 日期选择器。 2 个日期选择器。限制范围 : Max date of 2 weeks from the selected start date

Ajax 调用后 jQuery 日期选择器不起作用

jquery - 用特定颜色填充单元格日期选择器的一半