Action Bar Sherlock 4 title text color - where am I going wrong?

I'm having difficulty getting the color of the Action Bar title text to be white. The following examples believe that my code is correct, however the text looks black.

Can anyone see what I'm doing wrong?

<resources> <style name="Theme.MyApp" parent="Theme.Sherlock.Light"> <item name="actionBarStyle">@style/Widget.MyApp.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyApp.ActionBar</item> <item name="titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item> <item name="android:titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item> </style> <style name="Widget.MyApp.ActionBar" parent="Widget.Sherlock.Light.ActionBar"> <item name="background">@drawable/gradient_blue</item> <item name="android:background">@drawable/gradient_blue</item> </style> <style name="Widget.MyApp.TitleTextStyle" parent="Widget.Sherlock.Light.ActionBar"> <item name="titleTextStyle">@color/white</item> <item name="android:titleTextStyle">@color/white</item> </style> </resources> 

Thank you very much in advance!

+8
java android actionbarsherlock
source share
2 answers

Use the following, just configure the actionBarStyle property:

 <resources> <style name="Theme.MyApp" parent="Theme.Sherlock.Light"> <item name="actionBarStyle">@style/Widget.MyApp.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyApp.ActionBar</item> </style> <style name="Widget.MyApp.ActionBar" parent="Widget.Sherlock.Light.ActionBar"> <item name="titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item> <item name="android:titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item> </style> <style name="Widget.MyApp.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title"> <item name="android:textColor">@color/white</item> </style> </resources> 

and you can also customize the textSize header.

+18
source share

You must set the text color and other text property in the text style.

 <style name="Widget.MyApp.TitleTextStyle" parent="Widget.Sherlock.Light.ActionBar"> <item name="android:textColor">@color/white</item> </style> 
+1
source share

All Articles