iphone - 运行程序时保持 iphone 处于事件状态

标签 iphone objective-c

如何在我的应用程序运行时将 iPhone 设备设置为保持事件状态(不锁定)? 任何想法

最佳答案

我不确定这是否会阻止设备锁定,但您可以使用 UIApplicationidleTimerDisabled 阻止屏幕变暗属性:

[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/

相关文章:

iphone - 显示来自 iOS 本地服务器的动态网络内容(即使用浏览器作为远程屏幕)

iphone - 添加和删​​除键盘

objective-c - 将 NSData 转换为十六进制 NSString

iphone - 同时在 iPhone 中播放两个视频

ios - UIScrollView 奇数滚动

ios - 如何在 ios 中实现 seecarc(半圆形搜索栏)?

ios - 尝试在 Simulator swift 中添加安装 Spotify

iphone - performSelector 在所有实例上进入方法,但只有一个线程完成

objective-c - 从 Objective C 中的两个类继承

ios 6 - MKAnnotationView 中的问题