【发布时间】:2016-10-18 09:05:58
【问题描述】:
在react-native-ios 中,我使用react-native-datepicker 从日历中选择日期。
为此,我使用以下链接:
Date Picker in react-native-ios
我在我的渲染方法中添加以下代码:
<View style={styles.buttonContainer}>
<TouchableOpacity
style={[styles.bubble, styles.button]}
onPress={() => this.openCalender()}>
<DatePicker
style={{width: 150}}
date={this.state.date}
mode="date"
placeholder="Date"
format="YYYY-MM-DD"
minDate="2015-01-01"
maxDate="2025-12-01"
confirmBtnText="Confirm"
cancelBtnText="Cancel"
iconSource={require('./assets/cal.png')}
onDateChange={(date) => {this.setState({date: date});}}
/>
</TouchableOpacity>
</View>
但我想在对话框中添加此日期选择器。在react-native-ios 中实现它的方式是什么。
我想将日期选择器放在导航栏右键单击上。
【问题讨论】:
-
尝试使用github.com/pandiaraj44/react-native-datepicker-dialog 轻松实现android和ios的日期选择器。
标签: ios datepicker react-native