pop 提示窗背景,有時需要設置窗口的透明度
private void setLightMode(int lightMode) {
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
switch (lightMode) {
case LIGHT_OFF:
layoutParams.alpha = 0.7f;
break;
case LIGHT_ON:
layoutParams.alpha = 1.0f;
break;
}
getWindow().setAttributes(layoutParams);
}