2011-02-02 5 views
2

안녕 내 필요가 버튼을 하단에 보여, 그래서버튼 선형 레이아웃에 표시되지

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    android:padding="12dip"> 

    <ListView 
     android:id="@+id/list_multiselectable" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_vertical"> 
    </ListView> 
<LinearLayout android:orientation="horizontal"   

    android:background="@android:drawable/bottom_bar" 
    android:paddingLeft="4.0dip" android:paddingTop="5.0dip" 
    android:paddingRight="4.0dip" android:paddingBottom="1.0dip" 
    android:layout_width="fill_parent" android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true"> 

    my buttons code here 
</LinearLayout> 
    </LinearLayout> 

그러나 목록보기의 스크롤 막대 때까지 목록에있는 항목은 (덜하지 않을 때 가능으로 내 코드해야 모든 ), 버튼을 볼 수 있지만 목록의 항목이 더 많으면 버튼을 볼 수 없습니다. 마지막 행까지 항목을 스크롤했지만 마지막 버튼은 표시되지 않습니다. 어떻게 해결할 수 있습니까?

감사합니다.

답변

4

LinearLayout, 그것은 필요 ListView 모든 공간을주고있다.

내 제안은 RelativeLayout을 사용하는 것입니다.

<RelativeLayout ...> 
    <ListView ... 
      android:id="@+id/list" 
      android:layout_alignParentTop="true"/> 
    <LinearLayout ... 
      android:layout_below="@id/list" 
      android:layout_alignParentBottom="true"> 
    ...buttons... 
    </LinearLayout> 
</RelativeLayout> 
+0

목록보기 및 선형 레이아웃의 속성에 자세한 내용을 추가 할 수 있습니까? –

+0

Ohh의 작업 ........ 감사합니다! –

1

목록보기의 최소 높이를 설정할 수 있습니다. 예 : 320 * 480 listview height = 430 버튼의 레이아웃 높이 = 50

+0

동일한 문제가 계속되고 있습니다. –

2

잘 모르겠습니다. 그러나 당신은 당신의 listview의 무게를 놓는 것을 시도 할지도 모른다. 이 순차적으로 아이를 고려하고 계정에 따라 그 사람을 고려하지 않기 때문에

<ListView 
     android:id="@+id/list_multiselectable" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:layout_gravity="center_vertical"> 
    </ListView> 
관련 문제