📜  android 中的对话框背景变暗 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.909000             🧑  作者: Mango

代码示例1
Window window = dialog.getWindow();
if(window != null){
   window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); // This flag is required to set otherwise the setDimAmount method will not show any effect
   window.setDimAmount(0.5f); //0 for no dim to 1 for full dim
}