Nativebase: Extend selected Picker Item label

Created on 5 Mar 2018  路  3Comments  路  Source: GeekyAnts/NativeBase

Is there a way to parse a different label for a selected Item for a Picker? For example, my options are red, blue, and green. When I have red selected, I want the picker to display "red color"

react: 16.2.0
react-native: 0.53.0
native-base: 2.3.8

All 3 comments

@dipernaa That is not possible to do, NativeBase Picker is replacement of React Native Picker.
React Native Picker has not come across this feature

You can do this at max,

<Picker
       iosHeader="Select one"
       mode="dropdown"
       selectedValue={this.state.selected1}
       onValueChange={this.onValueChange.bind(this)}
       itemStyle={{ backgroundColor: 'lightgrey', marginLeft: 0, paddingLeft: 15 }}
       itemTextStyle={{ fontSize: 18, color: 'white' }}
       textStyle={{ color: "red" }}
>

338

i dont see why this is actually closed. none of itemStyle, itemTextStyle and textStyle worked for me.

https://docs.nativebase.io/Components.html#picker-text-and-item-text-styles-headref

Was this page helpful?
0 / 5 - 0 ratings

Related issues

georgemickael-b picture georgemickael-b  路  3Comments

agersoncgps picture agersoncgps  路  3Comments

Landerson352 picture Landerson352  路  3Comments

bsiddiqui picture bsiddiqui  路  3Comments

inv2004 picture inv2004  路  3Comments