Daniil Popov
Daniil Popov

Reputation: 471

AppCompat action bar size differ from ActionBarSherlock's size

I've decided to migrate from ActionBarSherlock (ABS) to AppCompat-v7. I ran into a problem. ActionBar became 56dp size instead of 48dp as it was in Holo theme. As I found in AppCompat resources the default action bar size is equal 56dp as in Material design. But I want my action bar looks like action bar in Holo theme. How can I specify necessary size for action bar? Maybe there is AppCompat-v7 with Holo instead of Material?

action bar comparison

Upvotes: 1

Views: 1260

Answers (3)

BladeCoder
BladeCoder

Reputation: 12929

The new AppCompat is meant to implement Material Design, so I encourage you to comply with the guidelines and use the default size. However, if you want to use a non-standard size for your material Action Bar, you can override actionBarSize in your theme:

<item name="actionBarSize">@dimen/bar_height</item>

If you want a true Holo ActionBar, you need to use AppCompat version 20.0.0, which is the last version to support Holo. But then you are stuck and can't use any new version of the support library.

Upvotes: 0

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364271

It is normal.

Appcompat v21 library enables you to bring the Material designs to older Android platforms.

If you would like to change the height you can use a Toolbar in your layout and set your favorite height.

<android.support.v7.widget.Toolbar
    android:id=”@+id/my_awesome_toolbar"
    android:layout_height="48dp"
    android:layout_width="match_parent"
    android:background="?attr/colorPrimary" />

In any case I suggest you to adopt the Material Desing and use the standard dimens. You can find more info here.

Upvotes: 2

Fahim
Fahim

Reputation: 12368

Use height attribute, actionBarSize if for something else.

<item name="android:height">@dimen/bar_height</item>

Upvotes: 0

Related Questions