在Android的,当你弹出一个对话框,在屏幕背后变暗。有什么办法来控制是什么样子?例如使其黯淡或多或少,或使用某种类型的模式?
In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern?
是的,确实如此。你可以控制它。
Yes, it is. You can control it.
在创建对话框:
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
lp.dimAmount=0.0f; // Dim level. 0.0 - no dim, 1.0 - completely opaque
dialog.getWindow().setAttributes(lp);
UPD :你甚至可以添加模糊对话框后面:
Upd: you can even add blur behind the dialog:
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
Blurring因为API14 是德precated:
Blurring is deprecated since API14:
此常数德precated在API级别14 模糊不再支持。
This constant was deprecated in API level 14. Blurring is no longer supported.
上一篇:Android的getAuthToken返回一个空令牌令牌、Android、getAuthToken
下一篇:Android的基本活动:基本的全局变量,无法从某些activites获得基本、全局变量、Android、activites