Change color changer for Android

I am working on an Android Tablet. I created a custom action bar and managed to create it the way I want, with the exception of the spinners.

My main theme extends Holo Light, meaning that when I press the spinner, it turns blue. How to change this?

+4
source share
1 answer

Specify your style for android:actionDropDownStyle in your theme, which itself has android:background for your custom list of states.

Here is the one specified by default:

 <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@drawable/spinner_ab_disabled_holo_dark" /> <item android:state_pressed="true" android:drawable="@drawable/spinner_ab_pressed_holo_dark" /> <item android:state_pressed="false" android:state_focused="true" android:drawable="@drawable/spinner_ab_focused_holo_dark" /> <item android:drawable="@drawable/spinner_ab_default_holo_dark" /> </selector> 

You will need to provide your own images for each of these states (and for mdpi, hdpi and xhdpi).

You can change the ones that come with the platform to make your life easier. Locate the SDK/platforms/platform-14/data/res/ in the drawable-mdpi , drawable-hdpi and drawable-xhdpi .

+1
source

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


All Articles