How to change the height of action bar in android 4.2.2

ε祈祈猫儿з 提交于 2019-12-05 22:52:59

To set the height of ActionBar you can create a new file themes.xml in your res/values folder:

<?xml version="1.0" encoding="utf-8"?>
<resources>   
    <style name="Theme.FixedSize" parent="@android:style/Theme.Holo.Light.DarkActionBar">
        <item name="actionBarSize">48dip</item>
        <item name="android:actionBarSize">48dip</item> 
    </style> 
 </resources>

and set this Theme to your Activity:

android:theme="@style/Theme.FixedSize"

Or just directly add the follow line inside the styles.xml:

    <item name="android:actionBarSize">35dp</item>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:textAllCaps">false</item>
    <item name="android:actionBarSize">35dp</item>
</style>

You only need to add item name="actionBarSize" 60dp item inside styles.xml.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!