0

我正在尝试创建一个带有 10 个按钮的 AlertDialog,但在 AlertDialog 中只有 3 个按钮。

4

2 回答 2

0

Try to use CustomDialog create your own layout and use that layout in your custom AlertDialog. Like this,

   private Dialog mForgetPasswordDialog;
   mForgetPasswordDialog = new Dialog(Signin.this);
    mForgetPasswordDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mForgetPasswordDialog.setContentView(R.layout.forget_password);
    mForgetPasswordDialog.setCancelable(true);

    TextView btnOk = (Button) mForgetPasswordDialog
            .findViewById(R.id.btnOk);
    // do your stug
    mForgetPasswordDialog.show();
于 2013-09-04T14:23:21.420 回答
0

解决方案是创建一个包含 10 个按钮的视图,并将其添加到您的对话框中

new AlertDialog.Builder().setView( your10ButtonView )...
于 2013-09-04T14:15:30.473 回答