我目前有一个带有标题的工具栏的导航抽屉,我希望将此标题置于工具栏中,但工具栏似乎没有考虑抽屉图标,如您所见下面的图片。Android中心标题与导航抽屉
而当我在这张照片使用不在抽屉式导航栏的标题完全居中内的其他活动相同的工具栏布局,如显示:
那么如何我是否会考虑这个图标?
这里是我的布局:
<android.support.design.widget.AppBarLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/Theme.App.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/black"
app:popupTheme="@style/Theme.App.PopupOverlay">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/white"
android:textStyle="bold"
android:text="Title"
android:textSize="16sp" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
谢谢@Chitrang你让我的日子 –
我需要在工具栏里显示imageview和TextView,我该怎么做 –