自定义图钉动画 - MKMapView [英] Custom pin animation - MKMapView

查看:103
本文介绍了自定义图钉动画 - MKMapView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序中使用了pin图像而不是标准引脚,现在我想给自定义引脚提供动画(与标准引脚相同的效果)。如何为自定义图钉图像提供下降动画效果????

I have used pin images in application instead of standard pin, now i want to give animation (dropping effect as it was with standard pins) to custom pins. How can i provide dropping animation effect to custom pin images????

推荐答案

实现以下委托方法。

- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views { 
   MKAnnotationView *aV; 
   for (aV in views) {
     CGRect endFrame = aV.frame;

     aV.frame = CGRectMake(aV.frame.origin.x, aV.frame.origin.y - 230.0, aV.frame.size.width, aV.frame.size.height);

     [UIView beginAnimations:nil context:NULL];
     [UIView setAnimationDuration:0.45];
     [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
         [aV setFrame:endFrame];
     [UIView commitAnimations];

   }
}

这篇关于自定义图钉动画 - MKMapView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆