2012-03-07 24 views
0

リストビューの後にAndroidレイアウトが表示されない場合リストビューのアイテムが多い場合は4〜5個の項目を追加します。 'android:layout_alignParentBottom = "true"'を使用すると、線形レイアウトは最後のリストビューアイテムになります。ListViewの項目が多い場合、Android LinearLayoutが表示されない

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/sereen_2_bg" > 

    <ListView 
     android:id="@+id/cartList" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:footerDividersEnabled="false" 
     > 
    </ListView> 

    <LinearLayout 
     android:id="@+id/linearCartFooter" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginRight="15dp" 
     android:layout_marginTop="5dp" 
     android:gravity="right" 
     android:orientation="vertical" 
     android:layout_below="@id/cartList" 

     > 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:gravity="right" 
      android:orientation="horizontal" > 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/total" 
       android:textColor="@color/white" /> 

      <TextView 
       android:id="@+id/txtCartTotal" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:background="@color/white" 
       android:padding="3dp" 
       android:text="@string/total" 
       android:textColor="@color/black" /> 
     </LinearLayout> 

     <Button 
      android:id="@+id/btnCartCheckout" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="10dp" 
      android:background="@drawable/sereen4_submit" /> 
    </LinearLayout> 
</RelativeLayout> 

答えて

1

私は下のレイアウトにalignParentBottom="true"を追加し、それが私の一番下のレイアウトと重ならないように

android:layout_marginBottom="75dp" 

ようなビューをリストする下マージンを適用することによって、この問題を解決することができました。

0

リストビューにもレイアウト図および底面図の上のすべての時間表示する場合は、あなたのListViewに、おそらくandroid:layout_below="@id/cartList"あなたのボタンに'android:layout_alignParentTop="true"'を追加します。

+0

私はこれをしましたが、私のボタンは画面外です。そして私はそれらを見ることができません –

+0

alignParentBottom = "true"を下のLayoutに追加しましたか? – Demonick

+0

はい私はこの問題を解決するために、alignParentBottom = "true"をbuttomレイアウトに追加し、リストマージンにボトムマージンを適用しました:) –

関連する問題