How can I change default black dim background “color” (not the amount of dim) of Dialog?

后端 未结 6 1017
野的像风
野的像风 2020-12-05 07:37

\"enter

(This is a random image of showing a Dialog found on the Internet

6条回答
  •  时光说笑
    2020-12-05 08:22

    try the code,

    View checkBoxView = View.inflate(context, R.layout.alertbox, null);
    
    
    
        final AlertDialog.Builder builder = new AlertDialog.Builder(context);
    
                 builder.setView(checkBoxView);
                 builder.setCancelable(false);
                    Dialog d = builder.create();
    
                    d.getWindow().setBackgroundDrawable(new ColorDrawable(0));
                    d.setView(checkBoxView, 0, 0, 0, 0);
                    d.show();
    

    nb: the line d.setView(checkBoxView, 0, 0, 0, 0); will make it...

提交回复
热议问题