ios - UIMapView : User location annotation is white not pulsing blue in iPad only

标签 ios iphone ipad mapping mkmapview

我使用 map 已经有一段时间了,所以我了解显示用户位置所需发生的事情的基础知识

map.showsUserLocation = YES; //also have the box checked in .xib

设置位置管理器

- (CLLocationManager *)locationManager {

if (locationManager != nil) {
    return locationManager;
}

locationManager = [[CLLocationManager alloc] init];
[locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
[locationManager setDelegate:self];

return locationManager;
}

我已经登录并看到我正在使用 didUpdateUserLocation 方法

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {

if (!userLoc)
{
    //NSLog(@"Mapping - didUpdateUserLocation");
    userLoc = userLocation.location;
}

    [locationManager startUpdatingLocation];
}

而且我还要确保我不会删除用户的注释

if (![annotation isKindOfClass:[MKUserLocation class]])

...那么为什么蓝点在 iPhone 上显示并闪烁,但仅在 iPad 上显示为白点? (两台设备均为 iOS 7.1.1)

最佳答案

只有配备蜂窝网络的 iPad 才能访问 GPS,这就是 MKMapView 中蓝色脉冲点所代表的。每部 iPhone 都有 GPS,这就是为什么您会在该设备上看到脉冲点。

如果没有蜂窝网络 (3G/4G/LTE),iPad 只能使用 WiFi 进行三角定位,这对于导航来说不够准确。

关于ios - UIMapView : User location annotation is white not pulsing blue in iPad only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24394950/

相关文章:

ios - 大小可以为 -[NSString drawInRect :] be determined by the string's content?

ios - UICollisionBehavior - UIView 碰撞的自定义形状

iPhone - 以编程方式更改应用程序设置

iphone - 禁用单个 UIView 的自动旋转

iphone - 如何配置 iPhone/iPad 文件与 Xcode 4.3 的关联?

带有 XCode 8 GM 的 iOS 10 导致 NSUserDefaults 间歇性无法工作

iOS swift : Sound not playing

ios - 不同 iPad 版本和 iPad 型号中的 UI 缩放?

javascript - iPad Safari iOS - SECURITY_ERR : Dom Exception 18 when accessing "document.cookie"

ios - 使用 instantiateViewControllerWithIdentifier 时从后台内存中删除 UIViewController 的正确方法是什么?