D. Rathore
D. Rathore

Reputation: 27

How to reduce gap between text and Hamburger icon on toolbar

My ImageI am using default toolbar design inside Appbar layout in XML.

Remove space between menu icon and title

<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"`enter code here`
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/toolbarColor"
            app:contentInsetStartWithNavigation="@dimen/_1sdp"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

Upvotes: 0

Views: 353

Answers (2)

abby
abby

Reputation: 410

A bit late to reply but it can help someone, currently by using androidx toolbar check the code below:

       <androidx.appcompat.widget.Toolbar
           ...
           app:contentInsetStart="0dp"
           app:contentInsetStartWithNavigation="0dp"
           app:titleMarginStart="0dp"/>

Just add these 3 lines

Upvotes: 2

Ferran
Ferran

Reputation: 1448

Add these 2 lines ...

        <android.support.v7.widget.Toolbar
            ...
            app:contentInsetLeft="0dp"
            app:contentInsetStart="0dp"
            ... 
         />

Upvotes: 0

Related Questions