【问题标题】:Android fill tab columns on android 4 on tablet sizeAndroid 在平板电脑大小的 android 4 上填充选项卡列
【发布时间】:2018-02-07 17:02:33
【问题描述】:

此屏幕截图适用于平板电脑尺寸的 android 4.3,我正在尝试填充列以修复它们,就像使用 match_parent 一样

我的 xml 布局:

   <android.support.design.widget.TabLayout
       android:id="@+id/categoriesTabsLayout"
       android:layout_width="match_parent"
       android:layout_height="40dp"
       android:background="@color/colorPrimaryDark"
       app:tabGravity="fill"
       app:tabMode="fixed"
       app:tabSelectedTextColor="@color/white"
       app:tabTextColor="@color/white"
       />

【问题讨论】:

    标签: android


    【解决方案1】:

    您应该添加 tabMaxWidth

    标签的最大宽度。

    可能是维度值,是附加的浮点数 带有诸如“14.5sp”之类的单位。可用单位有:px(像素)、dp (与密度无关的像素),sp(基于首选的缩放像素 字体大小)、in(英寸)和 mm(毫米)。

    <android.support.design.widget.TabLayout
          app:tabMaxWidth="0dp"
           />
    

    您可以查看Tabs in TabLayout not filling up

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-21
      • 2011-12-25
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      相关资源
      最近更新 更多