2012-03-14 25 views
0

我有一个AlertDialog里面的ListView,我遇到的问题是ListView只显示一行,即使在ListView中有多行。 AlertDialog似乎不会扩展。我怎样才能让它显示尽可能多的行?Android:在AlertDialog中的ListView只显示一行

在此先感谢。

约翰尼

+2

什么代码产生这样的AlertDialog? – dira 2012-03-14 04:19:27

回答

0

最终的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(); 
0

请参考以下职位列表视图一个警告对话框中:link