I'm trying to change the text color of the single item that is displayed in the spinner button after you select an item from the dropdown. I've been perusing the themes.xml and styles.xml in the Android SDK for an hour now, and I can't seem to find where the Spinner is getting the color value from.
To clarify, I'm NOT trying to change the color of a dropdown item, I'm trying to change the color of the spinner's displayed text when there is no dropdown. I guess you could call it the spinner's 'button' text.
You can hide spinner in the ProgressButton by setting the e-hide-spinner property to cssClass . Is this page helpful?
Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one. You can add a spinner to your layout with the Spinner object.
Adding spinner to app bar/ toolbar is very simple, you just need to create a XML file in res/menu/ folder and add a item like your over flow menu and spinner widget as item actionViewClass, rest in your java code. Spinner can be added to android actionbar/toolbar with many ways.
In Android, Spinners provides you a quick way to select one value from a set of values. Android spinners are nothing but the drop-downlist seen in other programming languages. In a default state, a spinner shows its currently selected value. It provides a easy way to select a value from a list of values.
I think it's probably this bit in styles.xml
<style name="Widget.TextView.SpinnerItem"> <item name="android:textAppearance">@style/TextAppearance.Widget.TextView.SpinnerItem</item> </style> <style name="Widget.DropDownItem.Spinner"> <item name="android:checkMark">?android:attr/listChoiceIndicatorSingle</item> </style>
-= EDIT =- Here's the result:
and here's how it's done:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="MooTheme" parent="android:Theme"> <item name="android:spinnerItemStyle">@style/MooSpinnerItem</item> </style> <style name="MooSpinnerItem" parent="android:Widget.TextView.SpinnerItem"> <item name="android:textAppearance">@style/MooTextAppearanceSpinnerItem</item> </style> <style name="MooTextAppearanceSpinnerItem" parent="android:TextAppearance.Widget.TextView.SpinnerItem"> <item name="android:textColor">#F00</item> </style> </resources>
Then just add this to the application tag in your AndroidManifest.xml
android:theme="@style/MooTheme"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With