所选选项卡下划线TabLayout颜色 [英] TabLayout color of selected tab underline
问题描述
如何更改所选标签的下划线的颜色在新的<一个href="http://developer.android.com/reference/android/support/design/widget/TabLayout.html">TabLayout?
该<一href="http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html">PagerTabStrip有一个方法 setTabIndicatorColor(INT颜色)
, TabLayout
似乎并不具备这样的方法。
How can I change the color of the underline of the selected tab on the new TabLayout?
The PagerTabStrip has a method setTabIndicatorColor(int color)
, TabLayout
doesn't seem to have such a method.
推荐答案
使用应用程序:tabIndicatorColor
例如:
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@android:color/white" />
请确保你有这样的命名空间
:的xmlns:程序=http://schemas.android.com/apk/res-auto
官方文档:<一href="http://developer.android.com/reference/android/support/design/widget/TabLayout.html">http://developer.android.com/reference/android/support/design/widget/TabLayout.html.
这篇关于所选选项卡下划线TabLayout颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!