Change ActionBarSherlock background color

The action bar background color is defined in a style for the action bar, not in the theme itself. You’ll need to do something like this:

<style name="Theme.MyTheme" parent="Theme.Sherlock.ForceOverflow">
    <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
    <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
</style>

<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
    <item name="android:background">#ff000000</item>
    <item name="background">#ff000000</item>
</style>

Be careful using colors defined in XML. ColorDrawable did not respect it’s view bounds on pre-Honeycomb so if you use tab navigation with a separate background for the stacked tab view you will have problems.

Leave a Comment