关闭iPhone OS(iOS)中的显示 [英] Turn off display in iPhone OS (iOS)

查看:150
本文介绍了关闭iPhone OS(iOS)中的显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以编程方式关闭iOS中的显示?不只是降低亮度,而是关闭电话应用程序的方式。我很乐意使用私有API,因为这是供个人使用。

is there a way to programmatically turn off the display in iOS? Not just turning brightness down, but off like the way the Phone App does. I am happy to use private API, since this is for personal use.

谢谢!

推荐答案

您可以通过启用接近监控来关闭显示屏。它会自动关闭屏幕,就像在手机应用程序中一样,将手机靠近耳朵或将手指放在手机顶部的红外传感器上。

You can turn off the display by enabling the proximity monitoring. It will automatically turn off the screen, like in the Phone app, by placing the phone near your ears or by placing a finger over the IR sensor at the top of the phone.

[UIDevice currentDevice].proximityMonitoringEnabled = YES;

这篇关于关闭iPhone OS(iOS)中的显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆