更改屏幕亮度的HTC Sense设备 [英] Changing screen brightness on a HTC Sense device
问题描述
旧的方法
Window window = getWindow();
LayoutParams layoutParams = window.getAttributes();
layoutParams.screenBrightness = newFloatValue;
window.setAttributes(layoutParams);
不会对HTC Desire采用合作的自动亮度在检查设置>显示>亮度。
是否有一个HTC特有的解决办法是什么?
doesn't work on HTC Desire with Automatic brightness checked in Settings > Display > Brightness.
Is there a HTC-specific workaround for that?
推荐答案
当然,你看不到任何变化,因为这些设置都设置为自动亮度。这意味着,任何手动更改被忽略。还是我失去了一些东西?
Of course you don't see any changes since the settings are set to Automatic Brightness. That means, any manual changes are disregarded. Or am I missing something?
我刚刚测试了一个的的HTC Desire HD(2.3.5)的和屏幕亮度的 DOES 的变化约1秒钟,但随后会立即重新调整/由自动亮度覆盖。但是,如果取消在设置自动亮度选项,就可以看到该值已正确更改。
I've just tested it on a HTC Desire HD (2.3.5) and the screen brightness DOES change for about a second, but then it's immediately re-adjusted/overwritten by the automatic brightness. However, if you uncheck Auto Brightness option in the settings, you can see that the value has changed correctly.
因此,国际海事组织一切工作正常。如果您希望您的更改生效,您可能需要关闭自动亮度第一:
So, imo everything is working as expected. If you want your changes to take effect you might have to disable Auto Brightness first:
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
这篇关于更改屏幕亮度的HTC Sense设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!