<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:tabTextAppearance="@style/TabLayoutTextStyle"
app:tabGravity="center"
app:tabMode="fixed"
app:tabTextColor="@color/c7"
app:tabSelectedTextColor="@color/c8"/>
关键是这两行代码
app:tabGravity="center"
app:tabMode="fixed"
TabLayout布局详解
本文介绍了在Android开发中使用TabLayout组件的关键属性设置方法,重点解析了如何通过设置app:tabGravity=center和app:tabMode=fixed来实现居中且固定宽度的标签效果。
297

被折叠的 条评论
为什么被折叠?



