搜索
您的当前位置:首页正文

解决华为手机pop弹出后背景色不发生变化的问题

来源:二三娱乐

public classWindowBackgroundUtils{

public static voidsetWindowBackground(Contextcontext,floatalpha){

WindowManager.LayoutParamslp=((Activity)context).getWindow().getAttributes();

lp.alpha=alpha;

((Activity)context).getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);

((Activity)context).getWindow().setAttributes(lp);

}

}
在设置背景属性之前添加flag。

Top