替代 Android 中的“FLAG_BLUR_BEHIND”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10372404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Alternative to "FLAG_BLUR_BEHIND" in Android?
提问by android developer
I can see that when I use the same flag as shown on the API-demos for blurring the background, I get a warning that it's deprecated:
我可以看到,当我使用 API 演示中显示的相同标志来模糊背景时,我收到一条警告,指出它已被弃用:
"The field WindowManager.LayoutParams.FLAG_BLUR_BEHIND is deprecated".
“不推荐使用 WindowManager.LayoutParams.FLAG_BLUR_BEHIND 字段”。
I've read about it, and I've found that "Blurring is no longer supported".
我读过它,我发现“不再支持模糊”。
Does it mean that it won't work on future versions? Why did they deprecate it? Is there an alternative? I really like this feature.
这是否意味着它不适用于未来的版本?他们为什么弃用它?有替代方案吗?我真的很喜欢这个功能。
采纳答案by android developer
ok , there is probably no alternative that uses the API , unless maybe i've forgetting anything.
好的,可能没有使用 API 的替代方法,除非我忘记了任何东西。
i can however use dimming , which is cool too, as written here:
然而,我可以使用调光,这也很酷,如这里所写:
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
lp.dimAmount=0.0f;
dialog.getWindow().setAttributes(lp);
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
回答by cV2
watch out that
当心
WindowManager.LayoutParams.FLAG_BLUR_BEHIND
WindowManager.LayoutParams.FLAG_BLUR_BEHIND
is deprecated.. (at least at Android 4.0 it leads to a black screen in background...)
已弃用..(至少在 Android 4.0 中它会导致后台黑屏......)
Reference (Source): http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html
参考(来源):http: //developer.android.com/reference/android/view/WindowManager.LayoutParams.html
int FLAG_BLUR_BEHIND This constant is deprecated. Blurring is no longer supported.
int FLAG_BLUR_BEHIND 此常量已弃用。不再支持模糊。
public static final int FLAG_BLUR_BEHIND
Since: API Level 1
This constant is deprecated.
Blurring is no longer supported.
Window flag: blur everything behind this window.
Constant Value: 4 (0x00000004)
what a pitty .. :( (was a nice effect ;))
真可怜.. :((效果不错;))
回答by Kishan B Manavadariya
I Think u should try ShowCaseView Library. For Highlighting the Elements on Android.
我认为你应该尝试 ShowCaseView 库。用于在 Android 上突出显示元素。
The ShowcaseView library is designed to highlight and showcase specific parts of apps to the user with a distinctive and attractive overlay. This library is great for pointing out points of interest for users, gestures, or obscure but useful items.
ShowcaseView 库旨在通过独特且有吸引力的叠加向用户突出显示和展示应用程序的特定部分。这个库非常适合指出用户的兴趣点、手势或晦涩但有用的项目。
Github Link : https://github.com/amlcurran/ShowcaseView
Github 链接:https: //github.com/amlcurran/ShowcaseView