picker
picker copied to clipboard
itemStyle applies to the whole component, not items.
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.
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.
Not sure if you're working on iOS or Android but I ran into this earlier then realized that itemStyle only works on iOS
That's true @KrisLau . I couldn't find a workaround for Android yet, do you have some suggestion for Android?
On the app I'm working on I just applied the item style directly on Picker.Item component like this:
<Picker.Item
...
style={...}
/>
running react-native-picker/picker: "2.4.2" There is still no way we can customize the Picker.Item on iOS
@LorandP I swapped to https://github.com/hossein-zare/react-native-dropdown-picker so maybe see if that suits your needs better.