小写的 TabLayout 选项卡标题文本
问题描述:
我在使用 Min SDK 15 的应用程序中使用了 android.support.design.widget.TabLayout
.
I have used android.support.design.widget.TabLayout
in my application with Min SDK 15.
默认情况下,它采用大写的 Tab 标题,但我希望它在textCapsWord"中制作.我尝试按照建议添加样式 here 和 此处.但不幸的是两者都不起作用.
By default it takes Tab title in capitals but I want it to make in "textCapsWord". I tried adding Style as suggested here and here. But unfortunate both doesn't work.
答
如果您将以下行添加到您的 TabLayout
中,它应该可以工作:
If you add the following line to your TabLayout
it should work:
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
像这样使用它:
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@android:color/white"
app:tabIndicatorHeight="2dp"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabSelectedTextColor="@android:color/white"
app:tabTextColor="@android:color/white" />