Actually, I want a dialog showing a listview at top and a bottom menu bar...
I want the dialog to adjust it's size to the listview and bottom bar
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg" >
<ListView
android:id="@+id/llList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/illBottom"
android:layout_alignParentTop="true"
android:choiceMode="multipleChoice" >
</ListView>
<com.actionbarsherlock.internal.widget.IcsLinearLayout
android:id="@+id/illBottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingLeft="4dip"
android:paddingRight="4dip" >
...
</com.actionbarsherlock.internal.widget.IcsLinearLayout>
Setting the listview to be above illBottom
and the LinearLayout to no relative position, the listview is not showing up... Setting it the way I have, makes the Dialog always maximum size (wrap_content for the ListView does not work...)
Maybe the Build-in-List does it for you:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setSingleChoiceItems(....
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.