Zsolt Safrany Zsolt Safrany - 2 months ago 8
Android Question

What's the height of the Android Toolbar?

What is the height of the Android

Toolbar
introduced in Lollipop? It's a quite simple question but I haven't found an answer here except for the
ActionBar
; but it has a different height.

Answer

The Toolbar (if not extended) has the height of:

  • 56dp (default)
  • 48dp (landscape)
  • 64dp (sw600dp; i.e. tablet)

The Toolbar is higher than the pre-lollipop ActionBar; it was 48dp by default, 40dp in landscape and 56dp in sw600dp.

And to retrieve the height of the Toolbar in XML, just use

?android:attr/actionBarSize

or if you're using the AppCompat library this

?attr/actionBarSize