是否可以减少TabLayout中的顶部和底部填充?

时间:2020-10-16 10:57:17

标签: android android-tablayout

我定义的TabLayoutlayout_height的{​​{1}}如下:

wrap_content

如下图所示。

TabLayout with non-fixed height

是否可以为<com.google.android.material.tabs.TabLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:tabBackground="@color/grey" app:tabGravity="fill" app:tabIndicatorColor="@color/textColorPrimary" app:tabIndicatorFullWidth="true" app:tabMode="fixed" app:tabTextColor="@color/textColorPrimary" /> 提供一些属性,同时将其TabLayout保留为layout_height –使其在垂直方向上更加紧凑,如下图所示?

TabLayout with fixed height

我尝试将wrap_contenttabPaddingTop的值设置为tabPaddingBottom,但这不会产生任何视觉变化。

0 个答案:

没有答案