从android导航抽屉图标中删除左边距 [英] Removing left margin from android navigation drawer icon

查看:146
本文介绍了从android导航抽屉图标中删除左边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我找到删除导航抽屉图标左边缘的方法(由下面的红色矩形表示)吗? 我在这里使用工具栏.

Can anybody help me to find the way to remove the left margin of the navigation drawer icon (mentioned by red rectangle below )? I am using toolbar here.

推荐答案

这会从工具栏中删除左侧边距.

This removes the left margin from toolbar.

mainToolbar.setContentInsetsAbsolute(0, 0);

或者您可以在工具栏xml中将左插图设置为0dp:

Or you can set left inset to 0dp in toolbar xml:

android:contentInsetLeft="0dp"

其他方法是在styles.xml中定义该填充:

Other way is to define that padding in the styles.xml:

<style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
  <item name="contentInsetStart">0dp</item>
  <item name="android:contentInsetStart">0dp</item>
</style>

如果所有这些解决方案均无效,请检查图像是否具有自己的填充.

If all of these solutions didn't worked please check if the image has its own padding..

这篇关于从android导航抽屉图标中删除左边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆