如何自定义操作栏选项卡 View 以具有所需的高度..?
我想要像这样带有操作栏选项卡的输出
但是我得到这样的输出
我通过设置自定义 View 在 tabview 上使用自定义 View
如何手动更改标签 View 的高度?
最佳答案
您可以使用 ActionBar.getHeight()
获取高度。
然后将其设置为您可以执行的特定高度:
先新建一个主题
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.FixedSize" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarSize">48dip</item>
<item name="android:actionBarSize">48dip</item>
</style>
</resources>
然后将主题设置为您的 Activity
android:theme="@style/Theme.FixedSize"
更新:
<style name="YourTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarTabStyle">@style/tab_nav</item>
<item name="android:actionBarTabTextStyle">@style/tab_nav_text</item>
<item name="android:actionBarSize">85dp</item>
</style>
关于android - 如何更改操作栏选项卡 View 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18438294/