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

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

作者: pengpengli | 来源:发表于2017-10-30 23:23 被阅读40次

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。

https://mp.weixin.qq.com/s?__biz=MzA3ODg4MDk0Ng==&mid=2651113830&idx=1&sn=7a968fa68abe54e68506a41a7831bfb5

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/rssppxtx.html