В моем mapview у меня в настоящее время есть bool animatesDrop для аннотаций, установленных как NO. Это связано с тем, что когда аннотации mapView отображаются на экране viewWillAppear, я не делаю их анимированными. Тем не менее, у меня также есть кнопка обновления, используемая для повторной привязки аннотаций и хотелось бы, чтобы они были анимированы (отбрасываются), когда это было нажато. Есть ли способ сделать это? Благодарю.iOS mapView animatesDrop
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if ([annotation isKindOfClass:[MKUserLocation class]]) {
return nil;
}
MyPin = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"current"];
UIButton *calloutButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIButton *directionsButton = [UIButton buttonWithType:UIButtonTypeCustom];
directionsButton.frame = CGRectMake(0, 0, 23, 23);
[directionsButton setBackgroundImage:[UIImage imageNamed:@"directions.png"] forState:UIControlStateNormal];
MyPin.leftCalloutAccessoryView = directionsButton;
MyPin.rightCalloutAccessoryView = calloutButton;
MyPin.draggable = NO;
MyPin.highlighted = NO;
MyPin.animatesDrop= YES;
MyPin.canShowCallout = YES;
return MyPin;
}