Dim iPhone Screen, but don't let it sleep

前端 未结 5 793
无人及你
无人及你 2021-01-31 18:12

Update

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScreen_Class/index.html#//apple_ref/occ/instp/UIScreen/brightness

That\'s the Ap

5条回答
  •  情书的邮戳
    2021-01-31 18:28

    Starting with iOS 5 you can set UIScreen's brightness:

    This property is only supported on the main screen. The value of this property should be a number between 0.0 and 1.0, inclusive.

    Brightness changes made by an app remain in effect only while the app is active. The system restores the user-supplied brightness setting at appropriate times when your app is not in the foreground. So if you change the value of this property, you do not need to record the previous value and restore it when your app moves to the background.

提交回复
热议问题