简体   繁体   中英

Android Spinner Color style

Is there a way of changing the color of the Spinner control? For example, Android 6 will render text with an arrow. I need to change the color of that arrow.

The change should apply to any version of android.

For example, Android 4 has underline with corner triangle. I have seen some approaches where you replace the icon that is being drawn, but that solution would not work for me. I need to change the color of the default icon.

在此输入图像描述

Update

I have found how to apply style on Android Spinner using styles.xml,

  <item name="android:spinnerStyle">@style/SpinnerItem</item>

but I cannot find what is the correct style to apply for the icon color to change.

It turns out, there is no nice way of doing this. It is possible to change the images used for the spinner, but then I would need to provide different set of images for each version, and also have conditionals / logic on the android code, to specify which set should be used based on version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM