I am working on Actionbar using Sherlock library. I want to change the Background Image of the Actionbar and Tabs differently. Currently I have changed the Background of the
Instead of doing that, you can use Style for Tabs:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarTabTextStyle">@style/CustomTabTextStyle</item>
<item name="android:actionBarDivider">@drawable/ab_divider</item>
<item name="android:actionBarItemBackground">@drawable/ab_item_background</item>
</style>
<!-- style for the action bar tab text -->
<style name="CustomTabTextStyle" parent="@android:style/TextAppearance.Holo">
<item name="android:textColor">#2456c2</item>
</style>
</resources>
check this article for more details.
you can use this code:
actionBar.setStackedBackgroundDrawable(new ColorDrawable(yourColor)); // for example new ColorDrawable(Color.BLUE)
To Change Actionbar Tab's color, Pls use this code:
//For Example if you want White color as Tabs background, then
getActionBar().setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#FFFFFF")));