所选选项卡下划线TabLayout颜色 [英] TabLayout color of selected tab underline

查看:1041
本文介绍了所选选项卡下划线TabLayout颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改所选标签的下划线的颜色在新的<一个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:程序=htt​​p://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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆