user2702700 user2702700 - 6 months ago 48
Android Question

How to change the height of action bar in android 4.2.2

Is it possible to change the height of action bar ? I have tried with ActionBar.setCustomView(view, layoutparams) but couldn't change the height.
Please suggest.Any help will be appreciated.

Answer

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"