获取屏幕,改变屏幕的亮度,透明度

来源:互联网 发布:网络回路测试软件 编辑:程序博客网 时间:2024/04/27 15:48

见到了贴上,以后用的到

WindowManager.LayoutParams lp =getWindow().getAttributes();                                                                             lp.screenBrightness=1.0f;                                                                                                        getWindow().setAttributes(lp);
范围0-1



backgroundAlpha(1.0f);

/** * 设置添加屏幕的背景透明度 * * @param bgAlpha 透明度 */public void backgroundAlpha(float bgAlpha) {    WindowManager.LayoutParams lp = getWindow().getAttributes();    lp.alpha = bgAlpha;    getWindow().setAttributes(lp);}

0 0
原创粉丝点击