我在下面实施了MKMapViewDelegate
方法,并显示了自定义用户位置注释。但是,当我带着iPhone走动时,注释没有移动。当我删除这个委托方法时,默认蓝点用户位置注释跟着我。
请告诉我如何移动自定义用户位置注释:
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString* AnnotationIdentifier = @"Annotation";
MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];
if (!pinView)
{
pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier] autorelease];
pinView.animatesDrop = NO;
pinView.canShowCallout = YES;
}
else
{
pinView.annotation = annotation;
}
pinView.image = [UIImage imageNamed:@"star.png"];
return pinView;
}