MKPinAnnotationView的animatesDrop属性
有大头针没有动画,设置以下animatesDrop=YES
如果想自定义大头针想有动画,那需要参考下面代码自己写个动画
- #pragma mark MKMapViewDelegate
- - (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
- {
- MKAnnotationView *annotationView;
- for (annotationView in views)
- {
- if (![annotationView isKindOfClass:[MKPinAnnotationView class]])
- {
- CGRect endFrame = annotationView.frame;
- annotationView.frame = CGRectMake(endFrame.origin.x, endFrame.origin.y - 230.0, endFrame.size.width, endFrame.size.height);
- [UIView beginAnimati*****:@"drop" context:NULL];
- [UIView setAnimationDuration:0.45];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
- [annotationView setFrame:endFrame];
- [UIView commitAnimati*****];
- }
- }
- }
http://blog.csdn.net/tongzhitao/article/details/7819539