2012-04-07 74 views
0

我正在嘗試將腳註添加到我的片段佈局。我所工作的罰款之前,我轉換的一切片段,現在頁腳顯示了上市片段上面,而不是下面:將粘腳添加到片段

<?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> 

回答

0

的LinearLayout不明白「layout_alignParentBottom」和「layout_above」。您應該刪除它們,並將TextView與片段交換。

「layout_alignParentBottom」和「layout_above」僅適用於嵌入在RelativeLayouts中的視圖。

+0

謝謝,你說得對,我的前片段佈局是RelativeLayouts。 – 2012-04-07 18:36:11