问题
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.
回答1:
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.
回答2:
Add the below line to your XML:
app:tabRippleColor="@android:color/transparent"
来源:https://stackoverflow.com/questions/37866240/remove-highlight-on-press-in-tablayout