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
How to stretch them to fill full width. Thanks.
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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.