Search code examples
iphoneobjective-cioscocoa-touchios5

How can we programmatically change the brightness of the iPhone screen?


How can I change the brightness of the screen programmatically using iPhone SDK?


Solution

  • [[UIScreen mainScreen] setBrightness: yourvalue];
    

    Requires iOS 5.0 or later. yourvalue is a float between 0.0 and 1.0.