2

I use Android actionbar and tabs and I want to change my tabs background color. I tried to apply it to the following in my style:

Widget.AppCompat.ActionBar
Widget.AppCompat.ActionBar.TabBar
Widget.AppCompat.ActionBar.TabView
Widget.AppCompat.ActionBar.Solid

It works in all cases, but dividers (little bars between each tab) are removed at the well. How can I avoid this?

keepthepeach
  • 1,621
  • 2
  • 20
  • 27

1 Answers1

1

You could define a style and apply it to your app or activity:

File styles.xml:

<style name="MyHoloLightTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionBarStyle">@style/ActionBarStyle</item>
    ....
<style name="ActionBarStyle" parent="...">
    <item name="background">@color/actionBarBackgroundColor</item>
    ...

File color.xml:

<color name="actionBarBackgroundColor">#00ff00</color>

Apply to app in AndroidManifest.xml:

<application
    ...
    android:theme="@style/MyHoloLightTheme"
    ...
Trinimon
  • 13,839
  • 9
  • 44
  • 60