问题
This is regarding the question: Turn off display in iPhone OS (iOS)
As alternative to turning off display, I am looking for a way to dim screen as much as possible.
I found following questions:
How to change brightness in iOS 5 app?
Make the iPhone Screen Dim
And this documentation:
http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIScreen_Class/Reference/UIScreen.html
Per this questions/documentation, I should be able to do this to dim screen additional to decreasing backlight.
[[UIScreen mainScreen] setWantsSoftwareDimming:YES];
I tried this code on my iPad 2 (iOS 6.0). However, I didn't notice any change in brightness of display.
a) Am I doing something wrong?
b) Were there any changes in iOS regarding this?
回答1:
setWantsSoftwareDimming: won't on itself do anything to the screen. It will instead change the scale that the brightness property of UIScreen uses. You should be calling it before you call setBrightness:. Perhaps if you post the method in which you set the brightness / call setWantsSoftwareDimming you might get some more useful feedback?
来源:https://stackoverflow.com/questions/12920715/change-to-wantssoftwaredimming-in-ios-6