<stylename= "Customtabpageindicator"Parent= "Widget.tabpageindicator"> <Itemname= "Android:background">@drawable/tab_indicator</Item> <Itemname= "Android:textappearance">@style/customtabpageindicator.text</Item> <Itemname= "Android:textsize">18sp</Item> <item name= "Android:textcolor" > @drawable/viewpager_title_textcolor</item> <Itemname= "Android:dividerpadding">8dp</Item> <Itemname= "Android:showdividers">Middle</Item> <Itemname= "Android:paddingleft">10dp</Item> <Itemname= "Android:paddingright">10dp</Item> <Itemname= "Android:fadingedge">Horizontal</Item> <Itemname= "Android:fadingedgelength">8dp</Item> </style>
Key changes
Viewpager_title_textcolor:
<?XML version= "1.0" encoding= "Utf-8"?><selectorxmlns:android= "Http://schemas.android.com/apk/res/android"> <!--Non focused states - <Itemandroid:state_focused= "false"android:state_pressed= "false"android:state_selected= "false"Android:color= "#99000000"/> <Itemandroid:state_focused= "false"android:state_pressed= "false"android:state_selected= "true"Android:color= "#f47240"/> <!--Focused states - <Itemandroid:state_focused= "true"android:state_pressed= "false"android:state_selected= "false"Android:color= "#99000000"/> <Itemandroid:state_focused= "true"android:state_pressed= "false"android:state_selected= "true"Android:color= "#f47240"/> <!--Pressed - <Itemandroid:state_pressed= "true"Android:color= "#f47240"/></selector>
Modify the color of the tabpageindicator underline