Ответ 1
Вы можете легко удалить Маржа | padding между значком заголовка и задней панели с помощью:
app:contentInsetStartWithNavigation="0dp"
Маржа | padding В левой/правой части панели инструментов:
app:contentInsetStart="0dp"
Также, если вам нужна дополнительная настройка, выполните следующие действия:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon_toolbar_left"
style="@style/IconFont.Large"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/text_toolbar_title"
style="@style/Textview.White.MediumSmall"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/icon_toolbar_right"
android:layout_toRightOf="@+id/icon_toolbar_left"
android:gravity="center"
android:text="@string/nav_category"/>
<ImageView
android:id="@+id/icon_toolbar_right"
style="@style/IconFont.Large"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>