如何在我的应用程序运行时将 iPhone 设备设置为保持事件状态(不锁定)? 任何想法
最佳答案
我不确定这是否会阻止设备锁定,但您可以使用 UIApplication
的 idleTimerDisabled
阻止屏幕变暗属性:
[UIApplication sharedApplication].idleTimerDisabled = YES;
来自文档:
Important: You should set this property only if necessary and should be sure to reset it to NO when the need no longer exists. Most applications should let the system turn off the screen when the idle timer elapses. This includes audio applications. With appropriate use of Audio Session Services, playback and recording proceed uninterrupted when the screen turns off. The only applications that should disable the idle timer are mapping applications, games, or similar programs with sporadic user interaction.
关于iphone - 运行程序时保持 iphone 处于事件状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/493495/