jhtong
jhtong

Reputation: 1589

Changing Button Text color in theme for >= Android 4.2

I've been searching but still am unable to find a way.

How does one change all text button colors (without modifying the android:textColor of other widgets in a scheme?

NB: Does not work

 <!-- Base application theme. -->
  <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorButtonNormal">#1bbc9b</item>
    <!--<item name="android:textColor">#ffffff</item>-->
    <item name="android:buttonStyle">@style/AppTheme.MyButton</item>
  </style>

  <style name="AppTheme.MyButton" parent="@android:style/TextAppearance">
    <item name="android:textColor">#ffffff</item>
  </style>

UPDATE: Fix for just altering button color, not entire button style

Upvotes: 0

Views: 472

Answers (1)

jhtong
jhtong

Reputation: 1589

This worked for me. In the values/styles.xml, configure:

  <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorButtonNormal">#fcfc00</item>
    <!-- more stuff here -->
  </style>

Upvotes: 1

Related Questions