picker icon indicating copy to clipboard operation
picker copied to clipboard

How set "Text Styles" like textTransform, textAlign etc..? Nothing works inside styles, also itemStyles is only for Ios!!

Open Satyam-code143 opened this issue 4 years ago • 9 comments

I am trying to get the text to the center and to change all the text to uppercase I am not able to do that in any kind of style. Not style property not in itemStyle property also tried in Picker.item style property.(ON ANDROID)

Here is my snippet:

<Picker
          selectedValue={language1}
          onValueChange={itemValue => setlanguage1(itemValue)}
          style={{
            width: '100%',
            textTransform: 'uppercase',
            textAlign: 'center',
          }}
          dropdownIconColor="#E4F7FF">
          <Picker.Item
            label="Java"
            value="java"
            style={{textTransform: 'uppercase', textAlign: 'center'}}
          />
          <Picker.Item label="JavaScript" value="js" />
</Picker>

None of this code is getting the text in "center" or transforming it in "uppercase".

Satyam-code143 avatar May 08 '21 10:05 Satyam-code143

I have the same issue and I am trying to understand what is going behind the scenes. Looks the Picker component does not take the styles to use them. It looks like it uses its own predetermined styling behind the scenes and we can not update most of the css.

rodz-dev avatar May 14 '21 22:05 rodz-dev

Same Issue. no styles are being applied.

wurlJAM avatar May 20 '21 03:05 wurlJAM

I'm having the same problem, I can't style anything. I wanted to style the prompt text which is too big and I couldn't either

osvaldokalvaitir avatar May 31 '21 23:05 osvaldokalvaitir

You can style for item by using itemStyle props in Picker tag, but this only works in IOS. In Android, you just only change the color of the label. I'm trying to read the source code of the package but cannot find anything else

cuongnv-dev avatar Jun 03 '21 03:06 cuongnv-dev

so I really wanted to change the size of the label and it's on android that I need!

I found a library that uses this same library but let me customize: react-native-picker-select

osvaldokalvaitir avatar Jun 03 '21 11:06 osvaldokalvaitir

@osvaldokalvaitir What library did you find?

ctwillie avatar Jul 01 '21 14:07 ctwillie

@ctwillie https://www.npmjs.com/package/react-native-picker-select

osvaldokalvaitir avatar Jul 01 '21 14:07 osvaldokalvaitir

Did anyone Find any solution ? Or I have to change Libary for just styling dropdown picker item?

zeeshan-shabbir avatar Apr 09 '22 09:04 zeeshan-shabbir

So it still is not possible to adjust the textAlignment?

Kreshnik avatar Oct 24 '23 14:10 Kreshnik