gpt4 book ai didi

iphone - 如何检测 iPhone OS 设备是否具有接近传感器?

转载 作者:行者123 更新时间:2023-12-03 20:36:45 26 4
gpt4 key购买 nike

与接近感应相关的文档指出,如果在没有接近传感器的设备(即 iPod touch、iPad)上使用接近感应 API,它们将返回,就像接近传感器已触发一样。

除了检查 [[UIDevice currentDevice].model] 字符串并解析“iPhone”、“iPod touch”或“iPad”之外,是否有更灵活的方法来确定给定设备上是否有接近传感器?

最佳答案

取自 UIDevice 文档:

proximityMonitoringEnabled

A Boolean value indicating whether proximity monitoring is enabled (YES) or not (NO).

...

Discussion

....

Not all iPhone OS devices have proximity sensors. To determine if proximity monitoring is available, attempt to enable it. If the value of the proximityState property remains NO, proximity monitoring is not available.

克劳斯

关于iphone - 如何检测 iPhone OS 设备是否具有接近传感器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2585554/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com