change custom tab text color when tabs active or disactive
hi. i have a question that i want active tab has same color with indicator !! how can i set custom color to active tab and disactive tab with this custom tab ? please answer me quick !! I'm doing project and must to solve this problem fast . tank you .
Hi
Please refer to the demo application. You can use the color selector. https://github.com/ogaclejapan/SmartTabLayout/blob/master/demo/src/main/res/color/custom_tab.xml
<com.ogaclejapan.smarttablayout.SmartTabLayout ... app:stl_defaultTabTextColor="@color/custom_tab" ...
(1) In your drawable add xml file called tab_state contains:-
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/while" android:state_selected="true"/>
<item android:color="@color/black" android:state_selected="false"/>
</selector>
(2)
<com.ogaclejapan.smarttablayout.SmartTabLayout ... app:stl_defaultTabTextColor="@color/tab_state" ...