I am trying to provide user settable colors in my app. White text on black background and black text on white background. I have multiple layouts with many listviews, both standard and custom adapters. People have suggested using Themes, but I have had no luck changing the text colors across all layouts. Can anyone show me an actual Theme layout that can accomplish this? I can easily change the background colors using myscreen.setBackGroundColor(xx), but when I try to change the text with a theme, it also changes spinner text as well.
Use
<item name="android:spinnerStyle">@style/StandardSpinner</item>
<item name="android:spinnerItemStyle">@style/StandardSpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/StandardSpinnerDropDownItem</item>
in your theme, this will override the Text style.
Your style will look something like this:
<style name="StandardSpinner" parent="@android:style/Widget.Spinner">
<item name="android:background">@drawable/spinner</item>
</style>
<style name="StandardSpinnerItem" parent="@android:style/Widget.TextView.SpinnerItem">
<item name="android:textAppearance">@style/GameDisplayText</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
<style name="StandardSpinnerDropDownItem" parent="@android:style/Widget.DropDownItem.Spinner">
<item name="android:textAppearance">@style/GameDisplayText</item>
</style>
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