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