我有一個需要距離檢測的功能,但我發現了一個令人困惑的問題。每當有東西接近超過 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(@"...");
}
}
uj5u.com熱心網友回復:
通過我的廣泛審查,我發現無法解決問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/496062.html
