iOS可以停止近距离检测的黑屏效果

发布于 2025-02-04 15:37:39 字数 480 浏览 1 评论 0原文

我的功能需要距离检测,但是我发现一个令人困惑的问题。每当某事接近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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜雨飘雪 2025-02-11 15:37:39

通过我的广泛评论,我发现无法解决问题是不可能的

Through my extensive review, I found that it was impossible to solve the problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文