iPhone: How do you suspend the screen saver-fader to have an app run for an hour? I need the app to be displaying info for an hour or more without the screen fading out to black.
iPhone:你如何暂停屏幕保护程序推文让应用程序运行一个小时?我需要应用程序显示一小时或更长时间的信息,而屏幕不会变黑。
Thanks
3 个解决方案
#1
4
Try:
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
But don't forget to re-enable the idle timer after an hour or you will just kill the battery of a forgotten device.
但是不要忘记在一小时后重新启用空闲计时器,否则你只会杀掉被遗忘设备的电池。
#2
2
The UIApplication class has an idleTimerDisabled property, just set that to false.
UIApplication类有一个idleTimerDisabled属性,只需将其设置为false。
[UIApplication sharedApplication].idleTimerDisabled = TRUE;
#3
1
UIApplication *thisApp = [UIApplication sharedApplication]; thisApp.idleTimerDisabled = YES;
UIApplication * thisApp = [UIApplication sharedApplication]; thisApp.idleTimerDisabled = YES;
Hope this helps!
希望这可以帮助!
#1
4
Try:
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
But don't forget to re-enable the idle timer after an hour or you will just kill the battery of a forgotten device.
但是不要忘记在一小时后重新启用空闲计时器,否则你只会杀掉被遗忘设备的电池。
#2
2
The UIApplication class has an idleTimerDisabled property, just set that to false.
UIApplication类有一个idleTimerDisabled属性,只需将其设置为false。
[UIApplication sharedApplication].idleTimerDisabled = TRUE;
#3
1
UIApplication *thisApp = [UIApplication sharedApplication]; thisApp.idleTimerDisabled = YES;
UIApplication * thisApp = [UIApplication sharedApplication]; thisApp.idleTimerDisabled = YES;
Hope this helps!
希望这可以帮助!