About Ambient Light sensor in iphone

前端 未结 2 583
無奈伤痛
無奈伤痛 2021-01-05 06:39

Thanks in advance.

I got the information about the iphone sensors from http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm. But I didn\'t get info

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 07:14

    It is possible, and the framework is public.

    You can activate the connection to the sensor like so :

    [[UIDevice currentDevice] setProximityMonitoringEnabled:YES]; 
    

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

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

    Here is a guide about iPhone sensors : iPhone sensors

提交回复
热议问题