Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove highlight on press in tablayout

enter image description here

How to disable this highlight on pressing the tab. I have been searching for half an hour and couldn't figure it out. I am using tablayout.

like image 681
Nikola Avatar asked Jun 16 '16 17:06

Nikola


2 Answers

Add the below line to your XML:

app:tabRippleColor="@android:color/transparent"
like image 181
Ranjan Avatar answered Oct 21 '22 13:10

Ranjan


just set the background color to transparent or to the background color of the tablayout. Add the following code to the parent layout.

 xmlns:app="http://schemas.android.com/apk/res-auto"

And add the following to tablayout.

app:tabBackground="?attr/colorPrimary"
android:background="?attr/colorPrimary"

This will solve your problem. Tested in Android M.

like image 32
Swathin Avatar answered Oct 21 '22 14:10

Swathin