Mit dieser Art in Ihrem styles.xml und den Stil Ihrer Registerkarte Layout zuweisen.
<style name="MyMaterialTheme.TabLayout" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@android:color/white</item>
<item name="tabIndicatorHeight">3dp</item>
<item name="tabTextAppearance">@style/MyMaterialTheme.TabLayout.TextAppearance</item>
<item name="tabSelectedTextColor">@android:color/white</item>
<item name="android:background">@color/colorPrimary</item>
</style>
<style name="MyMaterialTheme.TabLayout.TextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/tab_text_inactive</item>
<item name="textAllCaps">true</item>
</style>
Überprüfen Sie die Implementierung von here.
Nein Herr, ich habe TabLayout für Swipe Tabs verwendet, aber ich möchte die Titelfarbe eines Tabs ändern –
http://StackOverflow.com/a/7399342/2032561 – Bharatesh