How to change android button text color globally in theme

Zapnologica picture Zapnologica · Mar 28, 2016 · Viewed 28.9k times · Source

How can I change all my buttons text color?

I know I can set the background color like follows :

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    ...
    <item name="colorButtonNormal">@color/buttonColor</item>
</style>

How can I do this for the button Text?

Answer

Jois picture Jois · Mar 28, 2016
 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
   <item name="android:textColor">#yourcolor</item>
    <item name="android:buttonStyle">@style/ButtonColor</item>
    <item name="colorButtonNormal">@color/buttonColor</item>
</style>



<style name="ButtonColor" parent="@android:style/Widget.Button">
   <item name="android:textColor">@color/yourcolor</item>
</style> 

android:textColor This should help you change the text color globally. I hope this is helpful ThankYou