Respond to the collector is not displayed on android

I am trying to add a collector in response to my own android, but it does not appear on android. I match the date of my location with the selection, but I did not see the collector on the screen.

<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> 
+10
android react-native
source share
5 answers

You need to set the onValueChange method

I am trying to add a collector in responsive native Android, but it does not appear in Android. I match the date of my location with the selection, but I do not see it on the screen.

 <Picker style={{width: 100}} selectedValue={this.state.location} onValueChange={(loc) => this.setState({location: loc})}> <Picker.Item label="Location 1" value="1" /> <Picker.Item label="Location 2" value="2" /> <Picker.Item label="Location 3" value="3" /> </Picker> 
+15
source share

For me, it was "alignItems:" center "," on the parent view. "

I would comment on all / every style of your styles.container

+15
source share

Do you give it width and height? That was my problem

+9
source share

The picker does not appear on the screen if it does not have a style with the property of height, weight or flexibility

 <Picker style={{flex:1}} > <Picker.Item label="Location 1" value="1" /> <Picker.Item label="Location 2" value="2" /> <Picker.Item label="Location 3" value="3" /> </Picker> 
+4
source share

It worked for me too , assigning the width to the assembler specifically.

+1
source share

All Articles