在实际的开发中,有些场景需要设备保持常亮,下面一行代码搞定: iOS 使屏幕常亮代码: [[UIApplication sharedApplication] setIdleTimerDisabled:YES];