react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.47k stars 277 forks source link

background color is no applying for picker item in dark theme #451

Open ims7inc opened 1 year ago

ims7inc commented 1 year ago
<item name="android:spinnerItemStyle">@style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">@color/alert_text</item>
    <item name="android:background">@color/alert_background</item>
</style>
<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">@color/alert_text</item>
    <item name="android:background">@color/alert_background</item>
</style>

color is applying but background color is not applying after upgrading to 2.4.1 version

SWederell commented 1 year ago

I've added a pull request that should hopefully fix this (#453).

For the moment try adding a color property to your style tag for the Picker.Item like below:

<Picker.Item color="#fff" style={{ backgroundColor: "#000", color: "#fff", }} key={option.text} label={option.text} value={option.value} />