似乎可以更改用户位置的注释图像。 也许有人可以看到我误会的地方...

-(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
    if ([annotation isKindOfClass:[MKUserLocation class]]) {
        NSString* AnnotationIdentifier = @"Annotation";
        MKAnnotationView *annoationView = [mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];
        [annoationView setImage:[UIImage imageNamed:@"melocation"] ];
        return annoationView;
    }
}

===============>>#1 票数:1 已采纳

您无法在无法将其出列时首次忘记注释:

-(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
    if ([annotation isKindOfClass:[MKUserLocation class]]) {
        static NSString* const kAnnotationIdentifier = @"Annotation";
        MKAnnotationView *annoationView = [mapView dequeueReusableAnnotationViewWithIdentifier:kAnnotationIdentifier];
        if (!annoationView) {
            annoationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:kAnnotationIdentifier];
        }
        [annoationView setImage:[UIImage imageNamed:@"melocation"] ];
        return annoationView;
    }
    return nil;
}

  ask by ironRoei translate from so

未解决问题?本站智能推荐: