Tab 在平板设备上没有全宽 [使用 android.support.design.widget.TabLayout] [英] Tab not taking full width on Tablet device [Using android.support.design.widget.TabLayout]

查看:28
本文介绍了Tab 在平板设备上没有全宽 [使用 android.support.design.widget.TabLayout]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将标签设置为 UPDATE 29/05/2015 只需在 TabLayout xml 中添加 app:tabMaxWidth="0dp":

I have setup tabs as UPDATE 29/05/2015 this post. Tabs take full width on my Nexus 4 mobile but on nexus 7 tablet it in center and not cover full screen width.

Nexus 7 screenshot Nexus 4 screenshot

解决方案

A "simpler" answer borrowed from Kaizie would just be adding app:tabMaxWidth="0dp" in your TabLayout xml:

<android.support.design.widget.TabLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabMaxWidth="0dp"
            app:tabGravity="fill"
            app:tabMode="fixed" />

这篇关于Tab 在平板设备上没有全宽 [使用 android.support.design.widget.TabLayout]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆