대화 상자에 ListView가 있으며 목록 뒤에 버튼을 표시해야합니다.아래의 버튼이 제대로 작동하지 않는 목록보기
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/tvwGameOver" android:layout_weight="1" android:gravity="center"
android:textSize="25sp" android:visibility="gone"
android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/lloPlayerNames" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal" android:footerDividersEnabled="true"
android:headerDividersEnabled="true" android:layout_below="@id/tvwGameOver">
<TextView
android:id="@+id/tvwGameNumberHeader" android:layout_weight="1" android:gravity="right"
android:text="@string/scores_GameNumber" android:textSize="12sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginRight="13sp"/>
<TextView
android:id="@+id/tvwPlayer0Name" android:layout_weight="1" android:gravity="right"
android:textSize="12sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginRight="13sp"/>
<TextView
android:id="@+id/tvwPlayer1Name" android:layout_weight="1" android:gravity="right"
android:textSize="12sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginRight="13sp"/>
<TextView
android:id="@+id/tvwPlayer2Name" android:layout_weight="1" android:gravity="right"
android:textSize="12sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginRight="13sp"/>
<TextView
android:id="@+id/tvwPlayer3Name" android:layout_weight="1" android:gravity="right"
android:textSize="12sp"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginRight="13sp"/>
</LinearLayout>
<ListView
android:id="@+id/lvwScores" android:layout_below="@id/lloPlayerNames"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:divider="#FFFFFF" android:dividerHeight="1dip"
android:layout_weight="1"
android:footerDividersEnabled="true" android:headerDividersEnabled ="true"/>
<Button android:id="@+id/btnOK"
android:layout_height="wrap_content" android:layout_width="120dip"
android:layout_weight="1"
android:text="OK" android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
목록이 너무 커지면 버튼을 통과하고 버튼이 목록의 맨 위에 위치한다는 문제가 있습니다.
android : layout_below = "@ id/lvwScores"를 버튼에 추가하려고했지만 목록이 비어 있으면 화면 하단에서 목록 하단까지 버튼이 생깁니다.
android : layout_alignParentBottom = "true"를 제거하면 대화 상자가 작아집니다.
하루가 끝날 때, 하단에 버튼이있는 채로 화면의 일부가 여전히 비어 있어도 (점수 화면), 대부분의 화면을 채우려합니다.
아이디어가 있으십니까?
이 그것을 할 때 빈 모습입니다 : 목록이 축적 아래 버튼에서 중지되지 않는 바닥에 도달 할 때
그것은 것을 제외하고 중대하다.
RelativeLayout의 요점은 무엇입니까? 하단에 항상 버튼이 있습니까? 왜 LinearLayout을 사용하고 ListView에 1의 가중치를 부여하지 않는가? – dmon