Android 将粘性页脚添加到片段

Android 将粘性页脚添加到片段,android,android-layout,android-fragments,Android,Android Layout,Android Fragments,我正在尝试将页脚添加到片段布局中。在我将所有内容转换为片段之前,我工作得很好,现在页脚显示在列表片段的上方,而不是下面: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="fill_p

我正在尝试将页脚添加到片段布局中。在我将所有内容转换为片段之前,我工作得很好,现在页脚显示在列表片段的上方,而不是下面:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
>
    <!-- Footer -->     
    <TextView 
            android:id="@+id/footer" 
            android:background="#919191"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            style="@style/Footer"
            android:layout_alignParentBottom="true"
         />
    <!-- Footer -->

    <fragment android:name="com.app.ListingFragment"
            android:id="@+id/fragmentListing"
            android:layout_width="fill_parent"  
            android:layout_height="fill_parent" 
            android:layout_above="@id/footer"
     />

 </LinearLayout>

<style name="Footer">
    <item name="android:textColor">#ffffff</item>
    <item name="android:padding">2dip</item>
    <item name="android:background">#919191</item>
</style>

#ffffff
2dip
#919191

线性布局不理解“底部布局”和“上面布局”。您应该删除它们,然后用片段交换TextView


“layout\u alignParentBottom”和“layout\u above”仅适用于嵌入在RelativeLayouts中的视图。

谢谢,你说得对,我的片段前布局是RelativeLayouts。