CQM
CQM

Reputation: 44278

Android Toolbar has more padding than ActionBar, how to fix

I had to replace the actionbar to implement new UI patterns the design team wanted

The actionbar is now replaced with the ToolBar but the toolbar object is bigger than the actionbar, only marginably, but it is noticeable and not desired

Here is the XML declaration

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar"
    android:layout_height="?attr/actionBarSize"
    android:layout_width="match_parent"
    android:minHeight="?attr/actionBarSize"
    android:background="?attr/colorPrimary" />

How do I make it smaller? I used to be able to rely on actionBarSize which is already predefined for every screensize, I can put in a specific dp value but is that the solution for this object?

Thanks

Upvotes: 1

Views: 855

Answers (1)

?attr/actionBarSize is 56dp with new support lib. So even if you stick to actionbar you will get a bigger size. Set actionBarSize in your theme.

Upvotes: 3

Related Questions