Disable Material Ripple on Tablayout

梦想的初衷 提交于 2019-12-04 00:08:17
SpongeCake

app:tabBackground does not work in my case.

This is my solution:

tabLayout.setTabRippleColor(null);

Try to change the background, for example, use the transparent color of android.

 <android.support.design.widget.TabLayout
    android:layout_width="match_parent"
    android:layout_below="@id/toolbar"
    android:layout_height="70dip"
    app:tabBackground = "@android:color/transparent"
    app:tabMode="fixed" />

Add this line to TabLayout in XML: app:tabRippleColor="@null"

Clean code

tabLayout.setTabRippleColorResource(android.R.color.transparent);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!