user2429035
user2429035

Reputation: 23

how can I change the back ground color of split action bar in android

how can I change the back ground color of split action bar in android?In my application both split actionbar and actionbar is there.

Upvotes: 0

Views: 90

Answers (1)

Rohit Suthar
Rohit Suthar

Reputation: 2693

You can change action bar style through style.xml from values.

working with Android API 11+

<style name="Theme.Suthar" parent="@style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/ActionBar.Solid.Suthar</item>
</style>

<style name="ActionBar.Solid.Suthar" parent="@style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/red</item>
    <item name="android:backgroundStacked">@color/yellow</item>
    <item name="android:backgroundSplit">@color/green</item>
</style>

For AppCompat Theme:

<style name="Theme.Suthar" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    <item name="actionBarStyle">@style/ActionBar.Solid.Suthar</item>
</style>

<style name="ActionBar.Solid.Suthar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
    <item name="background">@color/red</item>
    <item name="backgroundStacked">@color/yellow</item>
    <item name="backgroundSplit">@color/green</item>
</style>

Upvotes: 2

Related Questions