0

AlertDialog Scrollable をプログラムで作成するにはどうすればよいですか?

私の 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();   

}

ネットで見つけたいくつかの解決策を試しましたが、うまくいきませんでした。

プログラムでスクロール可能にするための適切な解決策を教えてもらえますか?

4

1 に答える 1