Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native Nativebase-单击输入时如何显示日期选择器?_React Native_Native Base - Fatal编程技术网

React native Nativebase-单击输入时如何显示日期选择器?

React native Nativebase-单击输入时如何显示日期选择器?,react-native,native-base,React Native,Native Base,我正在使用NativeBase组件。我有表格,带有以下字段: <Item floatingLabel last> <Label>Buy dateі</Label> <DatePicker defaultDate={buyTime} locale={"en"} modalTransparent={false}

我正在使用NativeBase组件。我有
表格
,带有以下字段:

       <Item floatingLabel last>
          <Label>Buy dateі</Label>
          <DatePicker
            defaultDate={buyTime}
            locale={"en"}
            modalTransparent={false}
            animationType={"fade"}
            androidMode={"default"}
            placeHolderText="Change buy date"
            textStyle={{ color: "green" }}
            placeHolderTextStyle={{ color: "#d3d3d3" }}
            onDateChange={this.handleBuyTimeChange}
            disabled={false}
            ref={component => (this.buyTimePicker = component)}
          />
          <Input
            value={buyTime.toString().substr(4, 12)}
            onPress={() => {
              this.buyTimePicker.showDatePicker();
            }}
          />
        </Item>

购买日期і
(this.buyTimePicker=component)}
/>
{
this.buyTimePicker.showDatePicker();
}}
/>

但是点击
Input
不会触发
DatePicker
。如何解决这一问题?

您不能使用自己的输入组件自定义nativebase datepicker,如果您坚持,您可以使用任何第三方库,例如: