4

I have an iOS 7 app where I want to make the screen darker. I am adjusting the screen brightness using the following line:

[UIScreen mainScreen].brightness = 0.3;

This dims the screen as I expect, but if a user has auto brightness enabled the screen sometimes goes back to its original setting. Is there a way to disable auto brightness while in my app, or do I need to subscribe to the UIScreenBrightnessDidChangeNotification notification and just reset the brightness each time it is raised?

pimpo
  • 440
  • 2
  • 9
lehn0058
  • 19,977
  • 15
  • 69
  • 109

1 Answers1

1

You cannot disable the auto brightness at all, so you will have to subscribe to the notification. Read more about available methods in UIScreen:

Community
  • 1
  • 1
Legoless
  • 10,942
  • 7
  • 48
  • 68