0

How can I change the actionbar's height? I don't know why this isn't working. This is what have I done:

res/values/styles.xml

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> <item name="actionBarStyle">@style/ActionBarStyle</item> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style> 

I have created another styles.xml file, so this way I can use the android's namespace.

res/values-v11/styles.xml

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> 

And the actionbar's style file:

res/values/my_custom_style.xml

<?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="ActionBarStyle" parent="@style/Widget.AppCompat.ActionBar"> <item name="android:height">80dp</item> <item name="height">80dp</item> </style> </resources> 

The manifest file:

<application android:icon="@drawable/ic_launcher" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:screenOrientation="portrait" /> </application> 

This isn't working, the height didn't change. I have tested on Android 4.4.2.

1 Answer 1

1

Set actionBarStyle also on res/values-v11/styles.xml. This is necessary for compatibility support

res/values-v11/styles.xml

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarStyle">@style/ActionBarStyle</item> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.