How to change brightness in iOS 5 app?

前端 未结 4 1431
甜味超标
甜味超标 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:32

    I have never tried it, but looking at the docs it should go like this:

    UIScreen *mainScreen = [UIScreen mainScreen];
    mainScreen.brightness = .5; //should set the brightness at 50%
    

提交回复
热议问题