How to change brightness in iOS 5 app?

前端 未结 4 1428
甜味超标
甜味超标 2020-12-14 18:23

How would I program the ability to change brightness in-app? I know that its possible as I have seen at least three apps that can do it. This would be very useful for my app

4条回答
  •  悲&欢浪女
    2020-12-14 18:41

    As others pointed out you can use

    [[UIScreen mainScreen] setBrightness:1.0];
    

    BUT be very careful because you will run into problems (talking from experience here) look at this: IOS5 setBrightness didn't work with applicationWillResignActive and this: Anyone been able to use [[UIScreen mainScreen] setBrightness] on background / exit?

    (I wish I had, when I discovered this thread/answer) :-(

提交回复
热议问题