lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.74k stars 497 forks source link

Android background color #477

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>