how can I change the back ground color of split action bar in android?In my application both split actionbar and actionbar is there.
Asked
Active
Viewed 86 times
0
-
can you post code how r u used and what you want. – Hanuman Jul 03 '15 at 06:54
-
you want change color with the help of xml?? – Chaudhary Amar Jul 03 '15 at 06:57
-
http://stackoverflow.com/questions/19659637/how-to-change-the-background-color-of-action-bars-option-menu-in-android-4-2/19659779#19659779 – Sunny Jul 03 '15 at 07:23
-
@Allu
-
I want to change the color through code or through manifest. – user2429035 Jul 03 '15 at 07:44
-
are you using AppCompat? – Rohit Suthar Jul 03 '15 at 08:55
1 Answers
2
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>

Rohit Suthar
- 2,635
- 1
- 22
- 27