I have this AlertDialog
with and dynamic list in it(when a item from the list is selected the content of the list changes also). 问题是初始对话框的高度与其父级匹配,但是当内容更改并且大小小得多时,对话框会包裹内容。我怎样才能避免这种情况?
public ExplorerDialog(Context context, final SettingsDialog settingsDialog, int fileType) {
super(context);
setIcon(R.drawable.dialog_explorer_file_manager);
setTitle("Explorer Dialog");
setView(LayoutInflater.from(context).inflate(R.layout.dialog_explorer_layout, null));
setButton(BUTTON_POSITIVE, "Done", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
settingsDialog.show();
}
});
setButton(BUTTON_NEGATIVE, "Cancel", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
settingsDialog.show();
}
});
}