我目前有一個帶有標題的工具欄的導航抽屜,我希望將此標題置於工具欄中,但工具欄似乎沒有考慮抽屜圖標,如您所見下面的圖片。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,我該怎麼做 –