是否可以减少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,但这不会产生任何视觉变化。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)