【发布时间】:2014-08-15 04:57:33
【问题描述】:
我使用地图已经有一段时间了,所以我了解显示用户位置所需的基本知识
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)
【问题讨论】:
标签: ios iphone ipad mapping mkmapview