I have Tab text which is blue and background is white. I want to show blue background and white tab text when a tab selected.
I changed the background by using a selector. But I tried multiple times text color is not changing when selected. Please help me on this.
styles.xml
<style name="MainTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarTabTextStyle">@style/tab_text_color</item>
</style>
<style name="actionbar_tab_style" parent="@android:style/Widget.Holo.Light.ActionBar.TabBar">
<item name="android:background">@drawable/tab_background_select</item>
<item name="android:textColor">@drawable/tab_text_select</item>
</style>
tab_background_select.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_selected="true"
android:drawable="@color/blue"/>
</selector>
tab_text_select.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_selected="true"
android:color="#FFFFFF"/>
<item
android:state_selected="false"
android:color="#0000FF"/>
<!--
<item android:state_selected="true">
<shape>
<solid android:color="@color/white"/>
</shape>
</item>
<item>
<shape>
<solid android:color="@color/light_blue"/>
</shape>
</item> -->
</selector>