UPT
UPT

Reputation: 1480

Change to brightness of screen in iPhone

I am developing an iBook like application where user can change the brightness of the app by selection value of UISlider. I have done googling but I found the method GSEventSetBacklightLevel(1.0f); and this is undocumented and private. So I can not use this method in application. Please help me to provide brightness functionality in the application.

Upvotes: 0

Views: 1468

Answers (2)

Prakash Raj
Prakash Raj

Reputation: 1943

NSLog(@"brightness : %f",[[UIScreen mainScreen] brightness]);
    [[UIScreen mainScreen] setBrightness:.2];

Upvotes: 3

petert
petert

Reputation: 6692

I know that apps like Instapaper do a "software" brightness by changing the background between white and some shade of grey. The iBook app is probably therefore using some private API methods. There is of course display brightness in the Preferences app, which applies across all apps. Hope this helps.

Upvotes: 0

Related Questions