Iphone 带有自定义注释、调出和蓝色精度圆的当前位置

Iphone 带有自定义注释、调出和蓝色精度圆的当前位置,iphone,mkmapview,mkannotation,Iphone,Mkmapview,Mkannotation,在谷歌搜索了两个小时后,我找不到答案,所以这是我最后一次尝试 我想在mkmapview上为用户当前位置使用自定义注释。但我也想在它周围画一个蓝色的圆圈 这能做到吗 如果没有,我可以添加一个呼叫到默认的带圆圈的蓝点吗 我之所以需要它,是因为在我的应用程序中,当前位置点通常会在其他注释下消失。所以这就是为什么我用一个紫色的别针作为当前位置 以下是我的注释代码: if ([annotation isKindOfClass:MKUserLocation.class]) { MK

在谷歌搜索了两个小时后,我找不到答案,所以这是我最后一次尝试

我想在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

好的,所以我最终删除了自定义通知,但添加了一个自动弹出的呼叫。像这样:

mapView.showsUserLocation=TRUE;
mapView.userLocation.title = NSLocalizedString (@"Here am I",@"Here am I" );
[self performSelector:@selector(openCallout:) withObject:mapView.userLocation afterDelay:3.0];
以及:

-(void)openCallout:(id)注释{
[地图视图选择注释:注释动画:是];
}

如果没有延迟,呼叫将不会显示。

为此搜索了4小时,泰!
- (void)openCallout:(id<MKAnnotation>)annotation {
    [mapView selectAnnotation:annotation animated:YES];
}