2016-07-01 5 views
-3

私は4つの垂直部分に私のアンドロイド画面を分割しています、私は私の画面の下部にリストビューを表示したいですが、私はそれを底に伸ばした後でも、フルスクリーンを取る。どうやってするか ?私の活動の下部にリストビューを表示するには?リストビューの上に3つの線形レイアウトがあります

+0

使用のLinearLayoutとweightSum .. – Mohit

+0

場所、あなたのコードは、あなたの質問には、コードを更新し – Vickyexpert

+0

。 –

答えて

0

下のリストビューを表示することができます。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1"> 

     <!--First Part--> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1"> 

     <!--Second Part--> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1"> 

     <!--Third Part--> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1"> 

     <!--Fourth Part--> 
     <ListView 
      android:id="@+id/xListView" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"/> 

    </LinearLayout> 

</LinearLayout> 
0

あなたが一番下にしたいリストビューは常にあなたがrlativelayout使用する必要があり、その後見てする必要がある場合、これはあなた

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:weightSum="4" 
android:orientation="vertical" 
> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
    //first view.... 
</LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
    //second view.... 
    </LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
    //third view.... 
</LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
    //List view goes here.... 
</LinearLayout> 

0

に役立つことがあります。あなたのリストビューで、この属性android:layout_alignParentBottom = "true"を使用することで、下に適切に配置するのに役立ちます。垂直方向と

0

リニアレイアウトがより便利になります代わりに 相対レイアウトのここ

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:weightSum="4" 
android:orientation="vertical" 
> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
    </LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_weight="1" 
    android:layout_height="0dp"> 

    <ListView 
     android:id="@+id/mListView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"/> 
</LinearLayout> 
関連する問題