iOS可以停止近距离检测的黑屏效果
我的功能需要距离检测,但是我发现一个令人困惑的问题。每当某事接近1秒以上时,它都会变黑。我可以在开始距离检测的前提下停止黑屏吗
[UIDevice currentDevice].proximityMonitoringEnabled=YES;[[NSNotificationCenter
defaultCenter] addObserver:self selector:@selector(proximityStateDidChange:) name:UIDeviceProximityStateDidChangeNotification object:nil];
- (void)proximityStateDidChange:(NSNotification *)note
{
if ([UIDevice currentDevice].proximityState) {
NSLog(@"...");
} else {
NSLog(@"...");
}
}
I have a function that requires distance detection, but I find a confusing problem. Every time something approaches for more than 1 second, it will go black. Can I stop the black screen on the premise of starting distance detection
[UIDevice currentDevice].proximityMonitoringEnabled=YES;[[NSNotificationCenter
defaultCenter] addObserver:self selector:@selector(proximityStateDidChange:) name:UIDeviceProximityStateDidChangeNotification object:nil];
- (void)proximityStateDidChange:(NSNotification *)note
{
if ([UIDevice currentDevice].proximityState) {
NSLog(@"...");
} else {
NSLog(@"...");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过我的广泛评论,我发现无法解决问题是不可能的
Through my extensive review, I found that it was impossible to solve the problem