我正在开发一个应用程序,其中我在AlertDialog
. 在某些情况下,会出现对话框,显示其Title
和。问题是,当我在列表中添加超过 4 个条目时,设置的对话框消息被列表视图隐藏。无论列表有多长,我都想在消息下方显示列表视图。谁能帮我吗????Message
Custom listview
实施如下:
AlertDialog.Builder builder = new AlertDialog.Builder(xActivity.this);
builder.setTitle("Title");
builder.setMessage("Following items are in the List");
final ListView modeList = new ListView(xActivity.this);
ArrayAdapter<String> modeAdapter = new ArrayAdapter<String>(xActivity.this, android.R.layout.simple_list_item_1, android.R.id.text1, simpleArray);
modeList.setAdapter(modeAdapter);
modeList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
builder.setView(modeList);
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
// Do Something
}
}});
final Dialog dialog = builder.create();
dialog.show();
任何帮助表示赞赏.... :-)