I want to put tabs text(max 8 chars) in single line
I added a custom style to TabLayout element
<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabTextAppearance">@style/MyCustomTabTextAppearance</item>
</style>
<style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:maxLines">1</item>
<item name="android:singleLine">true</item>
</style>
Still it does not work out. I also tried
<android.support.design.widget.TabLayout
app:tabTextAppearance="@style/MyCustomTabTextAppearance"
..
..
/>
Just add app:tabMode="scrollable"
to TabLayout;
<android.support.design.widget.TabLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
app:tabMode="scrollable"
android:layout_height="wrap_content" />
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