IOS 7 Auto Brightness overrides app screen brightness setting

I have an iOS 7 application where I want to make the screen darker. I adjust the brightness of the screen using the following line:

[UIScreen mainScreen].brightness = 0.3;

This reduces the screen as I expect, but if the user has auto brightness turned on, the screen sometimes reverts to the original setting. Is there a way to turn off auto brightness in my application, or do I need to sign up for a UIScreenBrightnessDidChangeNotification notification and only reset the brightness every time it is raised?

+4
source share
1 answer

You cannot turn off auto brightness at all, so you have to sign up for a notification. More about the available methods in UIScreen:

+1

Source: https://habr.com/ru/post/1534085/


All Articles