How to style the react-native picker using android styles.xml?

后端 未结 1 1422
南方客
南方客 2021-01-12 00:13

I wanted to know how to set the fontFamily. How to set the color & background color on the Picker.items?



        
相关标签:
1条回答
  • 2021-01-12 00:39

    That's because you need to declare the styles inside your AppTheme

    <resources>
        <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
            <!-- Customize your theme here. -->
            <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
            <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
        </style>
        <style name="SpinnerItem">
            <item name="android:textColor">#ffffff</item>
            <item name="android:background">#993399</item>
        </style>
        <style name="SpinnerDropDownItem">
            <item name="android:textColor">#ffffff</item>
            <item name="android:background">#993399</item>
        </style>
    </resources>
    

    That's it :)

    0 讨论(0)
提交回复
热议问题