模式对话框Dialog背景的透明度&黑暗度设置方法
转载:http://www.eoeandroid.com/thread-12267-1-1.html
设置透明度(貌似是dialog自身的透明度)
WindowManager.LayoutParams lp=dialog.getWindow().getAttributes(); lp.alpha=1.0f; dialog.getWindow().setAttributes(lp);
dialog.setContentView(R.layout.dialog); WindowManager.LayoutParams lp=dialog.getWindow().getAttributes(); lp.dimAmount=1.0f; dialog.getWindow().setAttributes(lp); dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);