Android – reduces padding between navigation icons and logos on toolbars

Who knows how to reduce the padding between the navigation icon and logo on the toolbar. For some reason, there seems to be more space between them, and then between my logo and title

I've tried to add styles and use contentinset, but they don't seem to work

My layout

@H_403_9@<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

@H_403_9@<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)

resolvent:

If you are only interested in narrowing the fill between the navigation icon and the logo on the toolbar, use toolbar.setcontentinsetstartwithnavigation (0)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>