经过2小时的谷歌搜索,我找不到答案,所以这是我的最后一次尝试。
我想在mkmapview上使用自定义注释来标记用户当前位置。但我也想在周围有蓝色的精度圆圈。
这可行吗?
如果不行,我能否向默认的带圆圈的蓝点添加一个标注?
我需要这样做的原因是,在我的应用中,当前位置点经常消失在其他注释下面。所以我使用紫色大头针和标注作为当前位置。
以下是我的注释代码:
if ([annotation isKindOfClass:MKUserLocation.class])
{
MKPinAnnotationView *userAnnotationView = (MKPinAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:@"UserLocation"];
if (userAnnotationView == nil) {
userAnnotationView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"UserLocation"]autorelease];
}
else
userAnnotationView.annotation = annotation;
userAnnotationView.enabled = YES;
userAnnotationView.animatesDrop = NO;
userAnnotationView.pinColor = MKPinAnnotationColorPurple;
userAnnotationView.canShowCallout = YES;
[self performSelector:@selector(openCallout:) withObject:annotation afterDelay:0.01];
return userAnnotationView;
}
感谢您的任何建议。祝好,Christian。