Nativebase: Picker button text color

Created on 6 Aug 2017  路  8Comments  路  Source: GeekyAnts/NativeBase

react-native, react and native-base version

"react": "~15.4.1"
"react-native": "0.42.0"
"native-base": "2.1.0"
I used the ignite + native base boilerplate

Expected behaviour

I wanted to change the picker button text color to white, but couldn't.
I ejected the native base theme to customize it, and modified the file Button.js:

    '.picker': {
        paddingLeft:0,
        'NativeBase.Text': {
          fontSize: 17,
          color:'#ddd',
          '.note': {
            fontSize: 12,
            lineHeight: null,
          },
        },
      }

I removed the left padding from the button, and added the fontSize and color to the Text.

Actual behaviour

Unfortunately, only the padding was removed, the text is still black

Screenshot of emulator/device

capture d ecran 2017-08-06 a 16 29 38

Is the bug present in both ios and android or in any one of them?

I only tested on iOS simulator

Most helpful comment

this issue still exist on android only

All 8 comments

For those wondering, I changed all '#000' references to my text color in the Button.js file, and it fixed it. I suppose the picker uses a specific type of button, 'light' or 'dark'.

<Picker style={{ color: '#FFF' }} >

@elivinsky It works but causes an error in typescript.

Type '{ color: string; }' is not assignable to type 'StyleProp<ViewStyle>'. Property 'color' does not exist on type 'StyleProp<ViewStyle>'.

@achubai can you try textStyle prop of Picker

 <Picker
       textStyle={{ color: 'blue' }}
        ...
/>

@akhil-geekyants Unfortunately, it doesn't work properly on android.

download

Fixed with 2.4.2

thanx @akhil-geekyants , this one working for me.

 <Picker
       textStyle={{ color: 'blue' }}
        ...
/>

this issue still exist on android only

Was this page helpful?
0 / 5 - 0 ratings