怎么来设置[UIApplication sharedApplication]   idleTimerDisabled 属性来控制自动锁屏的效果

// 把设置idleTimerDisabled的代码放到applicationDidEnterBackground里还原系统设置

- (void)applicationDidEnterBackground:(UIApplication *)application {
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}

// 把设置idleTimerDisabled的代码放到applicationDidBecomeActive里取消自动锁屏效果
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
05-11 09:39