Does anyone know how to reduce the padding between de navigation icon and logo on a toolbar. for some reason it seems like there is way more space between them then between my logo and title.
I've already tried to add a style and use contentInset but none of them seem to work.
My layout
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_grey"
android:style="@style/ToolbarTheme"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:logo="@drawable/ic_launcher">
</android.support.v7.widget.Toolbar>
My style
<style name="ToolbarTheme" parent="Theme.AppCompat">
<item name="android:minWidth">0dip</item>
<item name="android:paddingLeft">0dip</item>
<item name="android:paddingRight">0dip</item>
</style>
Image (Space indicated by red lines should be smaller)
If you are interested only in Reducing padding between navigation icon and logo on my toolbar, use
Toolbar.setContentInsetStartWithNavigation(0)
Unlike
contentInsetStart
, this will modify the inset only when there is a Navigation Icon. In the absence of the Navigation Icon, you will still have the 16dp start inset.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With