简体   繁体   中英

Use proximity sensor without turning the screen off

这是一个很长的镜头,但是有没有人知道在使用接近传感器(UIDevice.proximityMonitoringEnabled和proximityState)时避免自动屏幕消隐的方法?

UIDevice only allows you to monitor the proximity sensor state and handle it within your app. You cannot control the blackening of the screen.

You can use this trick to temporary disable screen turn off

 UIDevice *device = [UIDevice currentDevice];
 [device setProximityMonitoringEnabled:YES];

But current public API do not allow to use proximity sensor without blacking out the screen. Any one have solution for this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM