Android 减少“我的工具栏”上导航图标和徽标之间的填充

Android 减少“我的工具栏”上导航图标和徽标之间的填充,android,icons,navigation-drawer,padding,toolbar,Android,Icons,Navigation Drawer,Padding,Toolbar,有人知道如何减少工具栏上导航图标和徽标之间的填充吗。出于某种原因,它们之间似乎比我的徽标和标题之间有更多的空间 我已经尝试过添加样式并使用contentInset,但它们似乎都不起作用 我的布局 <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_heig

有人知道如何减少工具栏上导航图标和徽标之间的填充吗。出于某种原因,它们之间似乎比我的徽标和标题之间有更多的空间

我已经尝试过添加样式并使用contentInset,但它们似乎都不起作用

我的布局

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

只需在工具栏xml中添加
app:contentInsetStart=“0dp”

添加
app:contentInsetStart=“0dp”
之前,输出为:

添加
app:contentInsetStart=“0dp”
后,输出为:

希望它能有所帮助。
完成

如果您只想减少“我的工具栏”上导航图标和徽标之间的填充,请使用
Toolbar.setContentInsertStartWithNavigation(0)

contentInsetStart
不同,这将仅在存在 是一个导航图标。如果没有导航图标,您将 仍然有16dp开始插入


您能发布带有导航图标和徽标的工具栏截图吗?您在其中遇到了问题。@Karthik我添加了一个图像,可能与我使用的相同的
app:contentInsertStart重复=“0dp
在我的
工具栏中,但它不工作。请帮助我解决此问题。”it@RavindraKushwaha你解决了吗?我也有同样的问题,将contentInsetStart设置为0dp没有帮助。@Rahul请参考此链接,它会对您有所帮助@Henry感谢您的澄清。
<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>