Search code examples
androidandroid-actionbarandroid-tabsandroid-styles

How to change ActionBar.Tab's strip color?


I want to change the strip color of ActionBar.Tabs and for that I am following this tutorial. But there are some errors that I cannot figure out. Here is the code in style.xml

<?xml version="1.0" encoding="UTF-8" ?>
<resources>


<style name="FindMyTrain.ActionBar.Tab">
    <item name="android:background">@color/red</item>
</style>


<style name="FindMyTrain" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarTabStyle">@style/FindMyTrain.ActionBar.Tab</item>
    <item name="actionBarTabStyle">@style/FindMyTrain.ActionBar.Tab</item>
</style>


</resources>

And these are the errors: Error

And I have no idea what am I doing wrong or what do these errors even mean. Any help would be appreciated. Thanks.


Solution

  • For the actionBar color, I suggest you use the Android asset studio here. It's a easy way to change the actionBar color and style. All you need to do is generate the style you want, download zip file, unzip it, copy all files (drawable folders) into your res folder and change your app theme in the AndroidManifest.xml to what you just generated from asset studio.