Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Material Ripple on 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?

Any ideas please?

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"/> 
like image 428
JayVDiyk Avatar asked Jan 04 '16 06:01

JayVDiyk


People also ask

How we can add tabs at runtime in tabLayout?

You create tabs via newTab() . From there you can change the tab's label or icon via TabLayout. Tab. setText(int) and TabLayout.


1 Answers

app:tabBackground does not work in my case.

This is my solution:

tabLayout.setTabRippleColor(null); 
like image 100
SpongeCake Avatar answered Sep 21 '22 17:09

SpongeCake