【问题标题】:android Tab Layout Design Libraryandroid标签布局设计库
【发布时间】:2015-10-13 10:52:52
【问题描述】:

我正在使用新的 android.support.design.widget 包中的 TabLayout。

<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" />

但在平板电脑上它们看起来像

如何拉伸它们以填满整个宽度。谢谢。

【问题讨论】:

    标签: android tabs


    【解决方案1】:

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

    凯兹的功劳

    像这样实现你自己的 TabLayoutStyle

    <style name="MyTabLayout" parent="Widget.Design.TabLayout">
            <item name="tabGravity">fill</item>
            <item name="tabMaxWidth">0dp</item>
    </style>
    

    【讨论】:

    • 非常感谢。它帮助了我。对不起,我没有看到那个帖子。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-24
    • 1970-01-01
    相关资源
    最近更新 更多