I'm not sure you need this anymore, but I will send an answer to other people. You can set this in the background Drawable customActionBarTabStyle as a Drawable resource:
<style name="customActionBarTabStyle" parent="style/Widget.Sherlock.Light.ActionBar.TabView"> <item name="android:background">@drawable/actionbar_tabs_selector</item> <item name="android:textSize">12dp</item> </style>
The resource must be a Selector, one of these lines:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/actionbar_tab_style_nselected"/> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/actionbar_tab_style_selected"/> <item android:state_pressed="true" android:drawable="@drawable/actionbar_tab_style_selected" /> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/actionbar_tab_style_nselected"/> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/actionbar_tab_style_nselected"/> </selector>
So, the resources here are 2 layer lists. One for when the tab is inactive, and the other for when the and tab is active. Thus, you set 2 lists of layers depending on the selected state.
One list of layers might look like this:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="@color/HCL_orange" /> </shape> </item> <item android:bottom="2dip"> <shape android:shape="rectangle"> <solid android:color="@android:color/white" /> </shape> </item> </layer-list>
Thus, the first element is the bottom line, which you can define as the underline color of the currently selected tab, and the second element is the color of the entire tab.
source share