Android经过透明度设置背景变暗

变暗blog

WindowManager.LayoutParams lp=getWindow().getAttributes();
lp.alpha=0.3f;
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
getWindow().setAttributes(lp);

  

变为原来的样子get

WindowManager.LayoutParams lp=getWindow().getAttributes();
lp.alpha=1.0f;                  getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
getWindow().setAttributes(lp);
相关文章
相关标签/搜索