2

Possible Duplicate:
ActionBar text color

I have a plain actionbar for a v14 project. The style is defined like this:

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#f00</item>
    <item name="android:textColor">#fff</item>
</style>

The background color is red, which is great, but the text remains black. I want it to be white. How do I get it to cooperate?

Also, is there a listing of all the xml attributes you can you with an ActionBar? The ActionBar doc does not seem to list them, unless I'm missing them:

http://developer.android.com/reference/android/app/ActionBar.html

that would be very helpful,

Thanks

Community
  • 1
  • 1
user291701
  • 38,411
  • 72
  • 187
  • 285

2 Answers2

12
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#f00</item>
    <item name="android:titleTextStyle">@style/MyTextAppearance</item>
</style>

<style name="MyTextAppearance" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">#ffffff</item>
</style>
Benito Bertoli
  • 25,285
  • 12
  • 54
  • 61
2

The easiest way to customize the actionbar is to use this awesome Actionbar Style Generator :

http://jgilfelt.github.com/android-actionbarstylegenerator/

simply chose the colors and styles you want, download the zip and import the resources into your project.(only support the Chrome browser right now).

Slickelito
  • 1,786
  • 20
  • 28