Is it possible to reduce light(brightness) of screen from code ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not a “published” API, therefore Apple will reject your sumbission from the App Store if you use it. So the short answer is “No”.
However…
An effective technique that people use is to place a UIView over your main window, give it a solid black background, then adjust the opacity to darken what shows behind it. I’ve done this by doing the following:
In your appDelagate’s “applicationDidFinishLaunching” call, where you would normally do:
Instead do:
Where “darkscreen” is an (IBOutlet) UIView created with Interface builder and in the MainWindow.xib as follows:
When you want to “dim” the screen, reference darkScreen from your appDelegate, and bump up it’s Alpha.