window.setBackgroundDrawableResource(android.R.color.transparent);
WindowManager m = mAlertDialogWindow.getWindowManager(); Display d = m.getDefaultDisplay(); //为获取屏幕宽、高 android.view.WindowManager.LayoutParams p = mAlertDialog.getWindow().getAttributes(); //获取对话框当前的参数值 p.width = d.getWidth(); //宽度设置为全屏 mAlertDialog.getWindow().setAttributes(p); //设置生效