改变动作条标签高度 [英] Change Actionbar Tabs Height

查看:128
本文介绍了改变动作条标签高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图改变低于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆