にリストが入力されているアプリケーションに取り組んでいますAlertDialog
。あるイベントでは、ダイアログが表示され、そのTitle
、Message
およびが表示されますCustom listview
。問題は、リストに4つを超えるエントリを追加すると、設定されているダイアログのメッセージがリストビューによって非表示になることです。リストの長さに関係なく、メッセージの下にリストビューを表示したいと思います。誰かが私を助けることができますか????
実装は次のとおりです。
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();
どんな助けでもありがたいです....:-)