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.0", Tab layout is all messed up.
The below image is my Tab Layout.
Xml Part :-
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@android:color/white"
app:tabIndicatorHeight="@dimen/dp2"
app:tabMode="fixed"
app:tabSelectedTextColor="@android:color/white"
app:tabTextAppearance="@style/MyCustomTabTextAppearance" />
styles xml :-
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/color_156084</item>
</style>
<style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">@dimen/sp14</item>
<item name="android:textColor">@android:color/white</item>
<item name="textAllCaps">false</item>
</style>
I have set padding to -1dp and even did tabGravity to fill but nothing is working.
This code used to work in earlier versions but now if i am downgrading it, i am getting a no class def found error on TintManager.
Tabs are created using newTab() method of TabLayout class. The title and icon of Tabs are set through setText(int) and setIcon(int) methods of TabListener interface respectively. Tabs of layout are attached over TabLayout using the method addTab(Tab) method.
Try adding below attributes to TabLayout:
app:tabPaddingStart="-1dp"
app:tabPaddingEnd="-1dp"
Hope it'll work.
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