react-native-picker / picker

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

dropdown background #396

Open okaybeydanol opened 2 years ago

okaybeydanol commented 2 years ago

All of them work except the background, but I couldn't get the background color to work. All I want is #000 for the background, but no matter what I tried, colorBackround popupBackround etc. I tried all of them but it didn't work

When I send color #fff in items, a white screen appears on android, and since the texts turn white on it, I set it on iOS without any trouble.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:forceDarkAllowed">false</item>
    <item name="android:navigationBarColor">#151617</item>
    <item name="android:windowBackground">#151617</item>
    <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
    <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
    <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
</style>

<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:fontFamily">sans-serif-light</item>
    <item name="android:textSize">18dp</item>
</style>

<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">#ffffff</item>
    <item name="android:textSize">18dp</item>
    <item name="android:fontFamily">sans-serif-light</item>
    <item name="android:gravity">center</item>
    <item name="android:background">#000</item>
</style>

<item name="android:background">@drawable/mydivider</item> // I tried that too, it didn't work

mydivider.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#000" />
<corners android:radius="7dp" />
<stroke
    android:width="3dp"
    android:color="#000" />
</shape>
zeeshan-shabbir commented 2 years ago

Same issue with me i cant change background of picker.item in android i was also asking this same issue but saw you already did . I am using react native select picker.

zeeshan-shabbir commented 2 years ago

Find any solution?

okaybeydanol commented 2 years ago

I've been trying for almost 7 8 hours, but I couldn't find a solution, it has nothing to do with the plugin, I tried other plugins, and they have the same problem. I guess there is a change in Android native codes. I haven't found what it is yet.

zeeshan-shabbir commented 2 years ago

Thanks if you find any solution post it here it will help other i am also searching this.

HAFDIAHMED commented 2 years ago

i need the solution please

Kishan-Somaiya commented 2 years ago

+1