如何以编程方式使我的 AlertDialog 可滚动?
我的 AlertDialog 是这样定义的:
private void DisplayAlertChoice(String title, String msg, final int pos)
{
alert = new AlertDialog.Builder(this);
alert.setTitle(title);
final LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
CheckBox[] t=new CheckBox[15];
for (i=0;i<currentBattery.temperatureNumber;i++)
{
t[i]=new CheckBox(this);
t[i].setText("title");
t[i].setChecked(false);
t[i].setOnCheckedChangeListener(this);
layout.addView(t[i]);
}
alert.setView(layout);
alert.show();
}
我尝试了一些在网上找到的解决方案,但对我不起作用。
有人可以给我一个相关的解决方案,让它以编程方式滚动吗?