我有一個AlertDialog裏面的ListView,我遇到的問題是ListView只顯示一行,即使在ListView中有多行。 AlertDialog似乎不會擴展。我怎樣才能讓它顯示儘可能多的行?Android:在AlertDialog中的ListView只顯示一行
在此先感謝。
約翰尼
我有一個AlertDialog裏面的ListView,我遇到的問題是ListView只顯示一行,即使在ListView中有多行。 AlertDialog似乎不會擴展。我怎樣才能讓它顯示儘可能多的行?Android:在AlertDialog中的ListView只顯示一行
在此先感謝。
約翰尼
HIII約翰尼
我看到你的問題,然後我測試了很多演示的最後我得到了那個
這裏的解決方案,我可以把鏈接,對你有幫助,你可以測試他們
http://android-codes-examples.blogspot.in/2011/03/how-to-display-alertdialog-and.html
最終的CharSequence []項= { 「富」, 「酒吧」, 「巴茲」};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Make your selection");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
// Do something...
}
});
AlertDialog alert = builder.create();
alert.show();
請參考以下職位列表視圖一個警告對話框中:link
什麼代碼產生這樣的AlertDialog? – dira 2012-03-14 04:19:27