How to keep iPhone screen from reducing backlight..?
My app shows a picture and then an mp3 plays over it, describi开发者_如何学编程ng the picture. The trouble is that the backlight on the screen reduces after 40 seconds or so, if the phone is not interacted with. How do I prevent the fade?...so that my picture doesn't go dark when they are looking at it.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
Set UIApplication
's idleTimerDisabled
property to YES
.
For swift the code will be:
UIApplication.sharedApplication().idleTimerDisabled = true
精彩评论