我的类被设置为位置管理器的委托(delegate),并且此代码中的日志会打印。
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager {
NSLog(@"will NOT display calibration");
[manager performSelector:@selector(dismissHeadingCalibrationDisplay) withObject:nil afterDelay:.25]; //This should never get displayed but does for some reason
return NO;
}
尽管如此,校准边框始终显示在应用程序上方。比它忽略我不显示的请求这一事实更烦人的是,自 5.1 以来,校准似乎极其敏感:只要手机靠近 radio 、计算机或其他不在开放区域的地方,它就会出现 - 大致每次我运行该应用程序时。
这会让我的用户疯狂,尽管我正在考虑从我的应用程序中删除标题。
有人知道如何真正关闭校准吗?这不是荒野生存工具。
最佳答案
我相信我知道是什么原因造成的。如果您使用 MKMapView,并且使用带航向的跟踪模式,则 map View 有自己的位置管理器,并且该位置管理器会自动设置为要求航向校准。真是一场噩梦,因为位置管理器是一个隐藏变量,无法访问它。
关于ios - iPhone : locationManagerShouldDisplayHeadingCalibration ignored/does nothing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9751970/