Android TabLayout tabPaddingTop and tabPaddingBottom not being removed
Please refer to the above issue as well.
Even since i updated my design library to \"23.2.
Try adding TabLayout in LinearLayout like:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF" />
</LinearLayout>
In Styles.xml add:
<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabTextAppearance">@style/MyCustomTextAppearance</item>
</style>
<style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
</style>
There are attributes in TabLayout : app:tabPaddingStart and app:tabPaddingEnd
You can set -1 to both of them in order to remove padding start and end in custom view of TabLayout.
<com.google.android.material.tabs.TabLayout
android:id="@+id/tlEmojis"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:tabPaddingStart="-1dp"
app:tabPaddingEnd="-1dp"
app:tabMaxWidth="@dimen/dimen_48dp"
app:tabMode="scrollable" />