我似乎无法在 TabLayout 内将选项卡标题向左对齐。目前,标题居中。这是什么I want https://i.stack.imgur.com/Vy6FP.jpg实现。
这就是I have https://i.stack.imgur.com/FYcHP.png眼下。
我使用的代码如下:
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabTextColor="@color/white"
app:tabSelectedTextColor="@color/white"
app:tabIndicatorColor="@color/white"
android:background="@color/slate_grey"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.design.widget.TabLayout>
add app:tabMode="scrollable"
给你的<TabLayout.../>
并且不要忘记添加xmlns:app="http://schemas.android.com/apk/res-auto"
too.
欲了解更多信息,请查看https://developer.android.com/reference/android/support/design/widget/TabLayout.html https://developer.android.com/reference/android/support/design/widget/TabLayout.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)