我正在尝试添加picker in react native android但它没有在android中显示.我将我的位置日期映射到选择器项目,但我没有在屏幕上看到选择器.
<Picker selectedValue={this.state.location}>
<Picker.Item label="Location 1" value="1" />
<Picker.Item label="Location 2" value="2" />
<Picker.Item label="Location 3" value="3" />
</Picker>Run Code Online (Sandbox Code Playgroud)
navigator当我从登陆屏幕注销时,我正在使用本机进行两个屏幕登录和登陆屏幕之间的通信,即使我可以从登录屏幕刷回到登陆屏幕,所以如何禁用刷卡反应本机导航器
当我使用Picker项目映射数组时,我收到以下警告:
数组中的每个子节点都应该具有唯一的"键"支柱.
这是我的代码
var locationArray = [{"name":"canada","id":"2"},{"name":"sweden","id":"3"}];
var Locations = locationArray.map(function(result) {
return <Picker.Item label={result.name} value={result.id} /> ;
});
return (
<ScrollView contentContainerStyle={styles.contentContainer}>
<View style={styles.container}>
<Picker selectedValue={this.state.location} onValueChange={(location) => this.setState({location:location})} style={[styles.picker, {color: '#2E3740'}]}>
{Locations}
</Picker>
</View>
</ScrollView>
);
Run Code Online (Sandbox Code Playgroud)