Stylization of a spinner, applet, material

So my application theme extends from the AppCompat Material Light theme with Dark Action Bar.

I applied accent color.

Now I'm trying to use Spinner on a dark background, and because of the theme, the spinner has a dark gray arrow, which when pressed changes to the color of the accent.

How can I make this spinning arrow white so that it is visible on a dark background?

Here's a picture of Spinner: enter image description here

+6
source share
3 answers

Thus, support library 22.1 allows you to use the android: theme attribute for views. This should help here.

+3
source

If you want to apply the same application for the spinner style, then in values/styles.xml , redefine spinnerStyle your style, which comes from the appomppat type and overrides android:background :

 <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="android:spinnerStyle">@style/AppSpinner</item> </style> <style name="AppSpinner" parent="Widget.AppCompat.Spinner"> <item name="android:background">@drawable/your_spinner_background</item> </style> 

If you need a quick way to create a spinner background, try android-holo-colors , select Colored Spinner and specify an accent color.

+3
source

with android: background you can specify your own background resource. I find the arrow pretty useless (clicking on the spinner displays a drop-down menu even without the arrow), so if you don’t want to draw your own arrow image, just leave a black or transparent background.

0
source

Source: https://habr.com/ru/post/981379/