WindowManager.LayoutParams lp=dialog.getWindow().getAttributes();
lp.alpha=0.5;
dialog.getWindow().setAttributes(lp);
本文介绍了一种通过修改WindowManager.LayoutParams属性来调整对话框透明度的方法。通过对alpha属性的设置,可以实现不同透明度的效果。
WindowManager.LayoutParams lp=dialog.getWindow().getAttributes();
lp.alpha=0.5;
dialog.getWindow().setAttributes(lp);
351
3801

被折叠的 条评论
为什么被折叠?