Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从我的应用程序中判断指南针是否受到干扰并要求用户重新校准?
当有指南针干扰时,我想获得与谷歌地图应用程序相同的行为。
谢谢。
实现 CLLocationManagerDelegate 方法以返回真值
-(BOOL)locationManagerShouldDisplayHeadingCalibration : (CLLocationManager *)manager { //do stuff return YES; }
如果在通知您事件后检测到干扰,这将告诉 LocationManager 执行重新校准。
如果您出于某种原因需要在自动删除覆盖之前关闭覆盖,请致电
- (void)dismissHeadingCalibrationDisplay