We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having an issue where my picker shows up, but the assigned values are not being displayed. Here is my code:
State:
this.state = { selectedItem: 0, showPicker: false, itemList: null, }
I set the value for itemList later on based on a database call.
this.setState({ showPicker: true, selectModel: false, itemList: a, });
When I call console.log("Values:", this.state.itemList), I get the expected response:
console.log("Values:", this.state.itemList)
Values: ["Select a Manufacturer", "Datex", "Ohmeda"]
Render:
this.state.showPicker && this.state.itemList != null ? <View style={{ bottom: '0%', flexDirection: 'column', flex: 0.37, backgroundColor: '#b8b8b8', justifyContent: 'center', alignItems: 'center' }} > <View style={{ backgroundColor: '#b8b8b8', width: '100%' }}> <Button title="Done" color={Platform.OS === "ios" ? "007AFF" : "#969696"} onPress={() => this.onPressHide()} /> </View> <View style={styles.container2}> <Picker style={styles.picker} selectedValue={this.state.selectedItem} itemStyle={{ color: "black", backgroundColor: "#b8b8b8", fontSize: 26 }} onValueChange={(index) => this.onPickerSelect(index)} > {this.state.itemList.map((value, i) => ( <PickerItem label={value} value={i} key={"money" + value} /> ))} </Picker> </View> </View>
I believe this is an issue with styling, but I'm not sure where I have made a mistake.
Styles:
picker: { width: "100%", }, container2: { flex: 0.84, bottom: "0%", width: '100%', justifyContent: 'center', alignItems: 'center', backgroundColor: '#b8b8b8', },
Here is a screenshot of the issue:
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Using version ^1.2.0
Sorry, something went wrong.
No branches or pull requests
I'm having an issue where my picker shows up, but the assigned values are not being displayed. Here is my code:
State:
I set the value for itemList later on based on a database call.
When I call
console.log("Values:", this.state.itemList)
, I get the expected response:Render:
I believe this is an issue with styling, but I'm not sure where I have made a mistake.
Styles:
Here is a screenshot of the issue:
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: