Removing left margin from android navigation drawer icon

纵饮孤独 提交于 2020-01-13 09:45:18

问题


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.


回答1:


This removes the left margin from toolbar.

mainToolbar.setContentInsetsAbsolute(0, 0);

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

android:contentInsetLeft="0dp"

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



来源:https://stackoverflow.com/questions/30301319/removing-left-margin-from-android-navigation-drawer-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!