Window localWindow = getWindow();
WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
localLayoutParams.screenBrightness = 0.5.0f; //(范围0-1, 值为-1时是自动调节)
localWindow.setAttributes(localLayoutParams);
WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
localLayoutParams.screenBrightness = 0.5.0f; //(范围0-1, 值为-1时是自动调节)
localWindow.setAttributes(localLayoutParams);
本文介绍了一种通过修改Window属性来调整Android应用屏幕亮度的方法。主要步骤包括:获取当前Window实例,设置新的亮度参数,并更新Window属性。

被折叠的 条评论
为什么被折叠?



