直播平台源代码,TabLayout标签较少时,如何居中显示
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@color/colorPrimary"
app:tabGravity="fill"
app:tabIndicatorColor="@color/colorAccent"
app:tabMode="fixed"
android:elevation="3dp"
app:tabSelectedTextColor="@color/colorAccent"
app:tabTextColor="#ffffffff">
</android.support.design.widget.TabLayout>
app:tabGravity=”fill”和 app:tabMode=”fixed”:在标签较少的时候,这两个属性同时使用,得到居中显示效果。
以上就是直播平台源代码,TabLayout标签较少时,如何居中显示, 更多内容欢迎关注之后的文章