How to remove space in Toolbar [duplicate]

断了今生、忘了曾经 提交于 2019-12-01 01:48:11

USe the app namespace and do like this:

app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"

Also, you might want to add:

app:contentInsetStartWithNavigation="0dp"

Remove contentInsetEnd attribute. I tried and this works

So it looks like this:

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        app:contentInsetLeft="0dp"
        app:contentInsetStart="0dp"
        app:contentInsetStartWithNavigation="0dp"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

Do you try app:titleMarginStart="0dp"?

You should use app prefix for contentInsetStart and contentInsetEnd and remove the android to avoid boilerplate code

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