I have two question with TabLayout
1)Can i remove TabLayout highlight or change highlight color of tab layout?
2)Can i add ripple effect for tab. Each tab contain TextView i try to add custom background something like this
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:drawable="@drawable/btn_white_bg" />
</ripple>
but it doesn't work.
com.google.android.material.tabs.TabLayout. TabLayout provides a horizontal layout to display tabs.
Change icon size on Android devices by going to Settings > Wallpaper & style > App grid and changing it to a grid with fewer or more columns and rows.
To remove the highlight, add the below line to your XML:
app:tabRippleColor="@android:color/transparent"
Another solution that works for me
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:minHeight="?attr/actionBarSize"
android:layout_width="match_parent"
app:tabMode="fixed"
app:tabGravity="fill"
android:clipToPadding="false"
android:elevation="0dp"
style="@style/MyCustomTabLayout"
android:background="@color/colorPrimary"
app:tabBackground="?attr/selectableItemBackground"
app:tabIndicatorColor="@color/app_yellow"
app:tabIndicatorHeight="4dip"
android:layout_height="wrap_content"/>
I just added following lines
android:background="@color/colorPrimary"
app:tabBackground="?attr/selectableItemBackground"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With