首页 > 代码库 > 修改TabPageIndicator下划线的颜色

修改TabPageIndicator下划线的颜色

   <style name="CustomTabPageIndicator" parent="Widget.TabPageIndicator">        <item name="android:background">@drawable/tab_indicator</item>        <item name="android:textAppearance">@style/CustomTabPageIndicator.Text</item>        <item name="android:textSize">18sp</item>        <item name="android:textColor">@drawable/viewpager_title_textcolor</item>        <item name="android:dividerPadding">8dp</item>        <item name="android:showDividers">middle</item>        <item name="android:paddingLeft">10dp</item>        <item name="android:paddingRight">10dp</item>        <item name="android:fadingEdge">horizontal</item>        <item name="android:fadingEdgeLength">8dp</item>    </style>

 

重点修改

viewpager_title_textcolor:

<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">    <!-- Non focused states -->    <item android:state_focused="false" android:state_pressed="false" android:state_selected="false" android:color="#99000000"/>    <item android:state_focused="false" android:state_pressed="false" android:state_selected="true" android:color="#f47240"/>    <!-- Focused states -->    <item android:state_focused="true" android:state_pressed="false" android:state_selected="false" android:color="#99000000"/>    <item android:state_focused="true" android:state_pressed="false" android:state_selected="true" android:color="#f47240"/>        <!-- Pressed -->    <item android:state_pressed="true" android:color="#f47240"/></selector>

 

 

修改TabPageIndicator下划线的颜色