工作中遇到dialog背景不透明,导致dialog弹出框在布局后面会有dialog的背景边框。
在Dialog中设置如下代码即可使Dialog背景透明。
AlertDialog dialog = new AlertDialog.Builder(mContext).create(); final Window window = dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(0));
工作中遇到dialog背景不透明,导致dialog弹出框在布局后面会有dialog的背景边框。
在Dialog中设置如下代码即可使Dialog背景透明。
AlertDialog dialog = new AlertDialog.Builder(mContext).create(); final Window window = dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(0));