문제

The only way I could find to programmatically turn off (not just dim) the iPhone's screen was by utilizing the UIDevice property proximityMonitoringEnabled, which will automatically turn off the screen if the infrared sensor detects proximity to an object while enabled.

Any other (public API only) methods for this? Any way to achieve a reverse-proximity effect (the screen dims when not proximal)?

도움이 되었습니까?

해결책

I am inclined to say no. Not by using a Public API. I believe that the only way to do this would be to use your method proximityMonitoringEnabled.

There was a way to use a Private API in iOS 5, but it appears that it does not work for iOS 6. (this answer covers iOS 5).

Your best bet is to use the proximityMonitoringEnable and proximityState.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top