Android action bar: change the color of action buttons

I have an application with an action bar that looks like this:

http://postimage.org/image/ozwy8o4x7/

I would like the text of the Home and Exit menu buttons to be white. How to change text color?

Let me know if you want to see any code.

Thanks!

+4
source share
1 answer

As I understand it, this is a simple android:actionMenuTextColor attribute android:actionMenuTextColor .

To use it correctly, you must create your own styles, for example:

 <?xml version="1.0" encoding="utf-8"?> <resources> <style name="myTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionMenuTextColor">@color/actionBarText</item> </style> <style name="myTheme.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name="android:titleTextStyle">@style/myTheme.ActionBar.Text</item> </style> <style name="myTheme.ActionBar.Text" parent="@android:style/TextAppearance"> <item name="android:textColor">@color/actionBarText</item> </style> </resources> 

And then set the color @ color / actionBarText to the color of your choice. Here you can also define other values, for example, the background color.

+16
source

All Articles