首先说明一下,TabLayout 中如果只用一个item的时候,此时设置是不起作用,原因我也没查,估计是源码底层做了限制
<!--tabIndicatorColor 底下标签的颜色值-->
<!--tabSelectedTextColor 选中时的文字的颜色-->
<!--tabBackground 整个item的背景-->
<!--tabTextColor 默认item文字的颜色-->
<!--tabTextAppearance 指定 文字的大小-->
<!-- 设置TabLayout 文字的大小-->
<style name="TabLayoutTextStyle">
<item name="android:textSize">14sp</item>
</style>
<com.google.android.material.tabs.TabLayout
android:layout_width="match_parent"
android:id="@+id/tabLayout"
app:tabIndicatorColor="@color/text_press" //
app:tabSelectedTextColor="@color/text_press"
app:tabBackground="@color/mid_blue"
app:tabTextColor="@color/white"
app:tabTextAppearance=