How can I change the brightness of the screen programmatically using iPhone SDK?
Adjust the screen brightness automatically iPhone adjusts the screen brightness for current light conditions using the built-in ambient light sensor. Go to Settings > Accessibility. Tap Display & Text Size, then turn on Auto-Brightness.
The easiest way is to look on your keyboard for an icon that looks like a sun. It is usually found over the F1 and F2 keys, with the F1 key dimming the display and F2 brightening it. The shortcut key for brightness on a desktop computer only requires you to press F2 until you achieve the desired brightness.
[[UIScreen mainScreen] setBrightness: yourvalue];
Requires iOS 5.0 or later. yourvalue is a float between 0.0 and 1.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With