关于iphone中的Ambient Light传感器 [英] About Ambient Light sensor in iphone

查看:130
本文介绍了关于iphone中的Ambient Light传感器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前致谢。

我从 http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm 。但我没有得到有关如何在iphone中使用环境传感器的信息

I got the information about the iphone sensors from http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm. But I didn't get information about how to use ambient sensor in iphone

推荐答案

这是可能的,而且框架是公开的。

It is possible, and the framework is public.

您可以激活与传感器的连接,如下所示:

You can activate the connection to the sensor like so :

[[UIDevice currentDevice] setProximityMonitoringEnabled:YES]; 

BTW,它似乎没有使用光传感器,因为接近感应会调整到一个黑暗的房间。

BTW, it doesn't seem to be using the light sensor, because proximity sensing would tweak out in a dark room.

然而,当您将手机放在脸上时,API调用基本上会使屏幕空白。遗憾的是,没有用于互动。

However, the API call basically blanks the screen when you hold the phone up to your face. Not useful for interaction, sadly.

以下是关于iPhone传感器的指南:
iPhone传感器

Here is a guide about iPhone sensors : iPhone sensors

这篇关于关于iphone中的Ambient Light传感器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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