Pin animatesDrop mapView-iOS
Posted
by
user1724168
on Stack Overflow
See other posts from Stack Overflow
or by user1724168
Published on 2012-11-08T04:51:11Z
Indexed on
2012/11/08
5:01 UTC
Read the original article
Hit count: 460
ios
|mkannotation
I have implemented code as seen below. I would like to add animation with dropping effect. However, once I type pinView.animatesDrop does not recognize! I could not able to figure out what I am doing wrong?
- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation {
MKAnnotationView *pinView=nil;
if(![annotation isKindOfClass:[Annotation class]]) // Don't mess user location
return nil;
static NSString *defaultPinID = @"StandardIdentifier";
pinView = (MKAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if (pinView == nil){
pinView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID];
}
// Build our annotation
if ([annotation isKindOfClass:[Annotation class]]) {
Annotation *a = (Annotation *)annotation;
pinView.image = [ZSPinAnnotation pinAnnotationWithColor:a.color];// ZSPinAnnotation Being Used
pinView.annotation = a;
pinView.enabled = YES;
pinView.centerOffset=CGPointMake(6.5,-16);
pinView.calloutOffset = CGPointMake(-11,0);
//pinView.animatesDrop = YES;
}
pinView.canShowCallout = YES;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton setTitle:annotation.title forState:UIControlStateNormal];
[pinView setRightCalloutAccessoryView:rightButton];
pinView.leftCalloutAccessoryView = [[UIView alloc] init];
pinView.leftCalloutAccessoryView=nil;
/*UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[leftButton setTitle:annotation.title forState:UIControlStateNormal];
[pinView setLeftCalloutAccessoryView:leftButton];*/
return pinView;
}
© Stack Overflow or respective owner