4
我想根據這個草圖來實現內通過新程序兼容性庫提供了新的工具欄插件自定義佈局不正確的行爲的意見
所以我嘗試添加新在工具欄內部佈局組件,並將其重力屬性設置爲bottom | center_horizontal。但是看起來這個屬性完全沒有關係,我的子佈局總是位於工具欄的垂直中心和漢堡圖標的左側。
我的XML佈局看起來是這樣的:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="115dp"
android:background="?attr/colorPrimary"
app:titleTextAppearance="@style/title">
<RelativeLayout
android:layout_width="176dp"
android:layout_height="59dp"
android:background="?attr/colorPrimaryDark"
android:gravity="bottom|center_horizontal">
</RelativeLayout>
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/container_main"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ListView
android:id="@+id/drawer_menu"
android:layout_width="264dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
android:choiceMode="singleChoice"
android:divider="?android:colorBackground"
android:dividerHeight="1dp"/>
</android.support.v4.widget.DrawerLayout>
任何想法如何實現的內部工具欄子視圖正確對準?
是到Lorem存有替代) – 2014-10-31 18:41:13