我可以在不关闭屏幕的情况下监控 iPhone 接近传感器吗?还有风景
我已经让接近传感器正常工作,这样我就可以在接近时触发事件,但我试图将其用作一种紧急开关。问题是,每当接近时,屏幕就会关闭,这大大降低了应用程序的可用性:P此外,在横向模式下,接近传感器似乎不会激活(我看不到相机中的闪烁灯) )。有什么办法可以绕过这些标准事件和方法吗?
I've got the proximity sensor working so that I can trigger events when in proximity, but I'm trying to use it as a sort of dead man switch. The problem is that whenever in proximity, the screen turns off, which drastically reduces the usability of the app :P Also, the proximity sensor doesn't seem to activate when in landscape mode (I can't see the flashing light in my camera). Is there any way to get around these standard events and methods?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您当前的 UIDevice 有一个
proximityState
属性。可能有用。Your current UIDevice has a
proximityState
property on it. May be useful.