如果按照一般网上提供的方式设置背景色会将上一个界面的内容显示出来
WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.alpha = 0.2f; /*getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);*/ getWindow().setAttributes(lp);
出现这种问题是因为我们没有做一个处理,那就是添加注释中的代码,可以看到添加这个标签的作用,让这个window后面的内容模糊