ListView设置为wrap_content,但是随着ListView中item的增加,ListView将会覆盖到下方的View,View看不到。
利用android:layout_weight属性,让下方View具有更大权重,让下方的View能正常显示:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/..." >
<ListView
android:id="@+id/dialog_select_listview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100"
...... >
</ListView>
<LinearLayout
android:id="@+id/bottom_btn"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:layout_gravity="center"
android:layout_weight="1"
...... >
......
</LinearLayout>
</LinearLayout>