3

I am using TabLayout from new android.support.design.widget package.

<android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
        app:tabIndicatorColor="@android:color/white"
        app:tabMode="fixed" />

But on tablets they looks like

enter image description here

How to stretch them to fill full width. Thanks.

Raman Branavitski
  • 864
  • 1
  • 9
  • 22

1 Answers1

5

Taken the answer from Tab not taking full width on Tablet device [Using android.support.design.widget.TabLayout]

Credit goes to Kaizie

Implement your own TabLayoutStyle like this

<style name="MyTabLayout" parent="Widget.Design.TabLayout">
        <item name="tabGravity">fill</item>
        <item name="tabMaxWidth">0dp</item>
</style>
Community
  • 1
  • 1
Vincent Paing
  • 2,308
  • 3
  • 17
  • 29