改变动作条标签高度 [英] Change Actionbar Tabs Height
问题描述
我一直在试图改变低于Android操作栏,选项卡的高度。我寻觅了很多关于这一点,并试图像清单和更多的设置主题,以应用众多解决方案。下面是我所申请,但几个主题之一没有成功。
I've been trying to change the height of tabs below action bar in Android. I have searched a lot for this and tried many solutions like setting Themes to application in manifest and many more. Below is the one of the few themes which I have applied but no success.
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item>
<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>
</style>
和我自己也尝试这一个:
and I have also tried this one:
<style name="Widget.Holo.Tab" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:height">200dp</item>
</style>
<style name="MyTabTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarTabStyle">@style/Widget.Holo.Tab</item>
</style>
我要添加图标下方的图标和文字。请帮我解决这个问题。
I want to add an icon and text below icon. Kindly help me to resolve this.
先谢谢了。
推荐答案
好像设置页
有等于动作条的高度的高度
。尝试设置页
从 200 DP
的改变高度 80 DP
或动作条
从 80 DP
改变高度 200 DP
。虽然这可能不是你预期的答案。
Seems like the height of Tab
has to equal to the height of ActionBar
. Try to change the height of Tab
from 200 dp
to 80 dp
or change the height of ActionBar
from 80 dp
to 200 dp
. Although this might not be your expected answer.
<!--Start Theme custom action bar theme -->
<style name="LeActionBarTheme"
parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabStyle">@style/MyActionBarTab</item>
<item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item>
<item name="android:actionBarSize">60dp</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">@style/MyActionBar</item>
<item name="actionBarTabStyle">@style/MyActionBarTab</item>
<item name="actionBarTabTextStyle">@style/MyActionBarTabText</item>
<item name="actionBarSize">60dp</item>
</style>
<!-- ActionBarTab Styles -->
<style name="MyActionBarTab"
parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:height">60dp</item>
</style>
这篇关于改变动作条标签高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!