Tony
Tony

Reputation: 57

changing ActionBar's height in orientation mode

I have been using actionbar(android native) for a few days(jellybean 4.2). I tried to change the actionbar's height by adding such line in style.xml:

100dip

it works fine in landscapemode, but do not work in orientation mode.

in orientation mode, its height was not changed.

Upvotes: 1

Views: 2641

Answers (1)

Ahmad
Ahmad

Reputation: 72533

You just have to create dimensions for the height of the ActionBar in portrait and landscape mode:

values/dimens.xml:

<resources>
     <!-- dimension for the portrait ActionBar -->
     <dimen name="ab_height">100dp</dimen>
</resources>

values-land/dimens.xml:

<resources>
     <!-- dimension for the landscape ActionBar -->
     <dimen name="ab_height">120dp</dimen>
</resources>

Now you can use these dimensions like this:

<style [...]>
     <item name="android:actionBarSize">@dimen/ab_height</item>
</style> 

Upvotes: 1

Related Questions