[UIApplication sharedApplication].idleTimerDisabled = YES. After setting it, the screen will still lock after a period of time. What's going on?
Put settings idleTimerDisabled的代码放到AppDelegate里的applicationDidBecomeActivein
idleTimerDisabled
AppDelegate
applicationDidBecomeActive
- (void)applicationDidEnterBackground:(UIApplication *)application { [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; } - (void)applicationDidBecomeActive:(UIApplication *)application { [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; }
Logically speaking, after you set idleTimerDisabled to YES, the screen should not be automatically locked in the current app. Where did you set it up? Can you give me a more detailed code?
Put settings
idleTimerDisabled
的代码放到AppDelegate
里的applicationDidBecomeActive
inLogically speaking, after you set idleTimerDisabled to YES, the screen should not be automatically locked in the current app. Where did you set it up? Can you give me a more detailed code?