I'm trying to change all the TextColor of my buttons in my app to white and also trying to make it bold. But that isn't happening, I'm overwriting the android:Widget.Button
I'm developing for Jelly Bean 4.1.2
What am I doing wrong?
Theme definition in manifest
android:theme="@style/spui" >
The theme where I like to
<style name="spui" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:buttonStyle">@style/Buttonspui</item>
</style>
The style for the button itself
<style name="Buttonspui" parent="android:Widget.Button">
<item name="android:background">@drawable/btn_default_holo_light</item>
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">64dip</item>
<item name="android:textColor">#ffffff</item>
<item name="android:textStyle">bold</item>
</style>
The button
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="@string/edit"
android:id="@+id/btnEdit"
style="@style/Buttonspui"/>
For styling your
Button
you can use this:Go to the
drawable
folder and make an XML (e.g.button.xml
) file called "style" which contains the following:This is my code, you can make the necessary changes you want
Now call it in your layout XML (
mainactivity.xml
) like thisNow to change the font color and style you can use the following which comes as part of the
styles.xml
in the values folderNow call this in the layout XML (
mainactivity.xml
) like thisThe final code is:
Hope this helps :)