在布局上禁用材料纹波 [英] Disable Material Ripple on Tablayout

查看:45
本文介绍了在布局上禁用材料纹波的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除TabLayout的选项卡上的纹波效应".

I am trying to remove the Material Ripple Effect on my TabLayout's Tabs.

我想知道是否可以这样做?

I am wondering if it is possible to do this?

请问有什么想法吗?

我尝试将stateListAnimator设置为null,但仍然无法正常工作

I have tried setting the stateListAnimator to null but it still does not work

    <android.support.design.widget.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:stateListAnimator="@null"/>

推荐答案

app:tabBackground 在我的情况下不起作用.

app:tabBackground does not work in my case.

这是我的解决方案:

tabLayout.setTabRippleColor(null);

这篇关于在布局上禁用材料纹波的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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