About Ambient Light sensor in iphone

前端 未结 2 584
無奈伤痛
無奈伤痛 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 06:56

    Here's a link to a description of the ambient light sensor hardware with example code that shows how to access it.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题