Android 带有 RecyclerView 的抽屉在底部添加页脚

Android Drawer with RecyclerView add footer at bottom

我正在尝试在菜单底部添加页脚(Facebook 行)。

我正在为菜单中的项目使用带回收站视图的抽屉。

我已遵循此 tuto,只是 mod MyAdapter 检测页脚并在这种情况下使用页脚布局 facebook 行。

如何让菜单的最后一项位于底部? 与 this 相同,但具有回收站视图

像这样调整你的xml

<?xml version="1.0" encoding="utf-8"?>
 <android.support.v4.widget.DrawerLayout  xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_dark_menu"
android:elevation="7dp" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <include
        android:id="@+id/tool_bar"
        layout="@layout/tool_bar" >
    </include>

    <FrameLayout
        android:id="@+id/main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ffffff" />
</LinearLayout>

<RelativeLayout
    android:layout_width="320dp"
    android:layout_height="match_parent"
    android:layout_gravity="start" >

    <android.support.v7.widget.RecyclerView
        android:id="@+id/RecyclerView"
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/grey_dark_menu"
        android:scrollbars="vertical" >
    </android.support.v7.widget.RecyclerView>

    <LinearLayout
        android:id="@+id/footer_menu_facebook"
        android:layout_width="320dp"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#508bc3"
        android:orientation="horizontal"
        android:padding="3dp" >

        <ImageView
            android:id="@+id/rowIcon"
            android:layout_width="34dp"
            android:layout_height="34dp"
            android:layout_gravity="center_vertical"
            android:layout_margin="5dp"
            android:src="@drawable/menu_facebook" />

        <TextView
            android:id="@+id/rowText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_margin="5dp"
            android:text="@string/footer_menu_facebook"
            android:textColor="@android:color/white"
            android:textSize="18sp" />
    </LinearLayout>
</RelativeLayout>

</android.support.v4.widget.DrawerLayout>