基本上,我想更改操作栏中选项卡的高度。这个问题在 stackoverflow 上已经被问过好几次了,例如:
ActionBar 选项卡高度 https://stackoverflow.com/questions/9286638/actionbar-tabs-height
我已经尝试了大多数解决方案,但没有任何效果,这是我的代码。
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo">
<item name="android:scrollHorizontally">false</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:paddingRight">0dp</item>
<item name="android:actionBarSize">80dp</item>
<item name="actionBarSize">80dp</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item>
</style>
<style name="ActionBarTabStyle" parent="@android:style/Widget.Holo.ActionBar.TabView">
<item name="android:height">80dp</item>
</style>
显然,代码只改变了操作栏的高度,而不是我想要的标签栏的高度。这是供参考的图片:
正如您所看到的,底部的操作栏更高。但在操作栏模式下,选项卡高度保持不变。
为什么会发生这种情况?我错过了什么???
先感谢您 :)。
已解决,如以下所述:
带有导航选项卡的 ActionBar 根据屏幕方向改变高度 https://stackoverflow.com/questions/13827762/actionbar-with-navigation-tabs-changes-height-with-screen-orientation
and
https://code.google.com/p/android/issues/detail?id=41792 https://code.google.com/p/android/issues/detail?id=41792
显然这是来自 android sdk 的错误...尽管我从来没有遇到过这样的错误:(。希望这对其他人有帮助。