【发布时间】:2016-06-21 23:35:57
【问题描述】:
Android TabLayout tabPaddingTop and tabPaddingBottom not being removed
请同时参考上述问题。
即使我将我的设计库更新为“23.2.0”,标签布局也一团糟。
下图是我的标签布局。
Xml 部分:-
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@android:color/white"
app:tabIndicatorHeight="@dimen/dp2"
app:tabMode="fixed"
app:tabSelectedTextColor="@android:color/white"
app:tabTextAppearance="@style/MyCustomTabTextAppearance" />
样式 xml:-
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/color_156084</item>
</style>
<style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">@dimen/sp14</item>
<item name="android:textColor">@android:color/white</item>
<item name="textAllCaps">false</item>
</style>
我已将填充设置为 -1dp,甚至使用 tabGravity 进行填充,但没有任何效果。
这段代码曾经在早期版本中工作,但现在如果我降级它,我会在 TintManager 上收到 no class def found 错误。
【问题讨论】:
-
你能发布整个xml文件吗
-
标签内部有填充,。 xml的其他部分对其没有任何影响
-
@RahulGupta 你是如何解决这个问题的?我面临同样的问题。选项卡占用了额外空间并适合全屏显示。
标签: android android-tablayout androiddesignsupport