picker icon indicating copy to clipboard operation
picker copied to clipboard

itemStyle applies to the whole component, not items.

Open omer-to opened this issue 4 years ago • 6 comments

Hi

itemStyle does not apply to each item, but rather the picker itself. It is supposed to receive StyleProp<TextStyle> but none of the text styles apply to the labels (e.g., fontWeight, fontSize etc.)

style prop is also annotated as StyleProp<TextStyle> and that doesnt make sense. Both style and itemStyle do the same thing and their styling applies to the whole component. Please elaborate it.

omer-to avatar Jan 24 '21 11:01 omer-to

Yeah i'm struggling to figure out how to apply a custom font to the items. Ive tried passing the fontFamily into, style and/or item style on the Picker as well as applying it to the style on the Picker.Item, nothing seems to work.

CDBridger avatar Apr 15 '21 04:04 CDBridger

Not sure if you're working on iOS or Android but I ran into this earlier then realized that itemStyle only works on iOS

KrisLau avatar May 17 '21 19:05 KrisLau

That's true @KrisLau . I couldn't find a workaround for Android yet, do you have some suggestion for Android?

crismarucci avatar May 17 '21 20:05 crismarucci

On the app I'm working on I just applied the item style directly on Picker.Item component like this:

<Picker.Item
    ...
    style={...}
/>

KrisLau avatar May 17 '21 20:05 KrisLau

running react-native-picker/picker: "2.4.2" There is still no way we can customize the Picker.Item on iOS

LorandP avatar Aug 03 '22 13:08 LorandP

@LorandP I swapped to https://github.com/hossein-zare/react-native-dropdown-picker so maybe see if that suits your needs better.

KrisLau avatar Aug 03 '22 14:08 KrisLau