Android 新安卓工具栏的重力属性行为不正确';儿童观点

Android 新安卓工具栏的重力属性行为不正确';儿童观点,android,toolbar,android-appcompat,Android,Toolbar,Android Appcompat,根据这个草图,我试图在新AppCompat库提供的新工具栏小部件中实现自定义布局 所以我试图在工具栏中添加新的布局组件,并将其重力属性设置为“底部”、“中心”和“水平”。但这个属性似乎完全无关紧要,我的子布局始终位于工具栏的垂直中心和汉堡图标的左侧 我的XML布局如下所示: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.

根据这个草图,我试图在新AppCompat库提供的新工具栏小部件中实现自定义布局

所以我试图在工具栏中添加新的布局组件,并将其重力属性设置为“底部”、“中心”和“水平”。但这个属性似乎完全无关紧要,我的子布局始终位于工具栏的垂直中心和汉堡图标的左侧

我的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>


如何在工具栏内实现子视图的正确对齐,有什么想法吗?

编辑:
android:gravity
定义了如何对齐视图的内部内容(文本对齐、子视图等),而不是视图在其父视图中的对齐方式

改变

android:gravity="bottom|center_horizontal" 


它是Lorem Ipsum的替代品)
android:layout_gravity="bottom|center_horizontal"