Change Action Bar Title color

i have changed title color like this

actionBar.setTitle(Html.fromHtml("<font color='#ff0000'>ActionBarTitle </font>"));

From Jake Wharton's ActionBarSherlock site :

Mirrored Attributes

Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation.

Had to change MyTheme.ActionBarStyle to :

   <style name="MyTheme.ActionBarStyle" parent="@style/Widget.Sherlock.ActionBar">
     <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
     <item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
   </style>

Now the Title text color has changed.


Use below code to provide different color to actionbar text and actionbar background just use below theme in manifest against the activity in which you want output :)

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

    <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:titleTextStyle">@style/TitleBarTextColor</item>
        <item name="android:background">YOUR_COLOR_CODE</item>
    </style>

    <style name="TitleBarTextColor" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
        <item name="android:textColor">YOUR_COLOR_CODE</item>
    </style>

Simplest way that worked for me is to add the following in theme style:

<item name="android:textColorPrimary">@color/orange_dark</item>