我已经读到当我用 layoutparams 更改屏幕亮度时,它应该会在现场更新。
//preview brightness changes at this window
//get the current window attributes
LayoutParams layoutpars = window.getAttributes();
//set the brightness of this window
layoutpars.screenBrightness = brightness / (float)255;
//apply attribute changes to this window
window.setAttributes(layoutpars);
当我尝试它时,它没有。我不得不关闭并再次打开屏幕来设置亮度。
任何帮助,将不胜感激!