如何实现模糊的背景视觉效果

时间:2011-03-06 15:41:47

标签: android

请知道如何在Android中实现此效果(背景模糊)?

HTC WildFire shutting down

我的HTC WildFire会在即将关闭时执行此操作

1 个答案:

答案 0 :(得分:4)

我用Google搜索" android模糊背景"并找到了this blog post。基本上是:

dialog = new AlertDialog.Builder(this). /*... setTitle and so on ...*/ ;

WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
lp.dimAmount=0.0f;  // this sets the amount of darkening
dialog.getWindow().setAttributes(lp);  
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);