SmartTabLayout icon indicating copy to clipboard operation
SmartTabLayout copied to clipboard

change custom tab text color when tabs active or disactive

Open alirezanazari opened this issue 8 years ago • 2 comments

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 .

alirezanazari avatar Oct 12 '17 10:10 alirezanazari

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" ...

habeebrahmanpt avatar Nov 29 '17 06:11 habeebrahmanpt

(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" ...

Mustafa-Altameemi avatar Jan 05 '21 09:01 Mustafa-Altameemi