【发布时间】:2017-11-09 16:53:59
【问题描述】:
我在工具栏和汉堡图标之间出现了差距。即使我添加了 app:contentInsetLeft、app:contentInsetStart、app:contentInsetStartWithNavigation ,我仍然得到了差距。
我将以下代码添加到工具栏
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<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="60dp"
android:background="#fff">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hi, Ajay Jayendran"
android:textColor="#123"
android:textSize="20sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Good Morning"
android:textColor="#111"
android:layout_below="@+id/toolbar_title"
/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
我使用自己的汉堡图标作为导航抽屉。为此,我使用了以下代码,
toggle.setDrawerIndicatorEnabled(false);
toggle.setHomeAsUpIndicator(R.drawable.navigation_icon);
这里是图标和工具栏之间的截图
有人知道如何缩小汉堡图标和工具栏之间的空间吗?
【问题讨论】:
标签: android navigation-drawer toolbar