我正在使用 react-native-actionsheet 在 iOS 中显示下拉菜单,我能够获取选定的索引,但是,我也不知道获取选定值的语法是什么。
showActionSheet = () => {
this.ActionSheet.show()
}
handlePress = (buttonIndex, option) => {
this.setState({ selected: buttonIndex, Region: options})
}
<Text style={styles.inputfields} onPress={this.showActionSheet}>Region</Text>
<ActionSheet
ref={o => this.ActionSheet = o}
title={'Region'}
options={['North', 'South', 'East', 'West', 'Cancel']}
cancelButtonIndex={5}
selectedValue={this.state.Region}
value={this.state.Region}
onPress={this.handlePress}
/>