背景在ICS API级别14不会模糊活动时打开的对话框中的Android [英] Background not blur activity in ICS api level 14 when open dialog in android
问题描述
我做的背景图像模糊的应用程序时按钮的单击事件打开对话框及其API级别8(姜饼)和API级别14(ICS)没有背景图像模糊的工作其唯一的调光背景像淡黑,我做什么,
感谢提前
这是code在Android 2.3及4.0工作不工作,
AlertDialog alertDialog = alertDialogBuilder.create();
WindowManager.LayoutParams LP = alertDialog.getWindow()的getAttributes()。
lp.dimAmount = 0.0;
。alertDialog.getWindow()setAttributes(LP);
。alertDialog.getWindow()addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
alertDialog.show();
FLAG_BLUR_BEHIND
是德$ P $在API级别14 pcated。
模糊不再支持。
块引用>按戴安娜Hackborn 的Android框架工程师
我建议避免这一点。早在G1天模糊效果可能
在软件中有所有效执行。那些日子很长
过去。这是你应该避免,直到在某个时刻
未来当在GPU上完成的。
块引用>I making apps for background image blur when open dialog on button click event and its working for api level 8(Gingerbread) and api level 14 (ICS) not background image blur its only dimming background like on light black, what i do, Thanks for in Advance
This is code working on Android 2.3 and 4.0 not working,
AlertDialog alertDialog = alertDialogBuilder.create(); WindowManager.LayoutParams lp = alertDialog.getWindow().getAttributes(); lp.dimAmount=0.0f; alertDialog.getWindow().setAttributes(lp); alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); alertDialog.show();
解决方案
FLAG_BLUR_BEHIND
was deprecated in API level 14.Blurring is no longer supported.
As per Dianne Hackborn Android framework engineer
I recommend avoiding this. Back in the G1 days the blur effect could be implemented somewhat efficiently in software. Those days are long past. This is something you should avoid until at some point in the future when it is done on the GPU.
这篇关于背景在ICS API级别14不会模糊活动时打开的对话框中的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!