【发布时间】:2018-10-09 13:30:03
【问题描述】:
我在 AlertDialog 中有一个列表;
public void thesaurusBtnAction(){
// setup the alert builder
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Synonyms List");
// add a list
String[] someList = {"a", "b", "c", "d", "e","a","b"};
builder.setItems(someList, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case 0:
case 1:
case 2:
case 3:
case 4:
}
}
});
// create and show the alert dialog
AlertDialog dialog = builder.create();
dialog.show();
}
我想将此处的列表设为可滚动列表,并将 AlertDialog 的大小限制为一定的大小,因为 AlertDialog 会随着列表的增长尝试增加其大小。
【问题讨论】:
-
我很糟糕,它是上述问题的副本。我认为如果我只是使用 setLayout() 调整大小,它将无法滚动。我会将其标记为重复
标签: android listview android-studio android-alertdialog