开发者

Animating custom callout for MKAnnotationView in MKMapView with "pop in" effect

I finally managed to put together a custom callout UIView that gets shown when a MKAnnotationView is tapped. I did this by overriding

- (void)setSelected:(BOOL)selected animated:(BOOL)animated;

in my custom MKAnnotationView subclass. Note: I prevented the main callout from showing by setting t开发者_如何学Gohe canShowCallout property to NO.

I'd like to try and replicate the animation that the standard callout uses... It seems to bubble up -- going a little bigger than intended, and then back to it's normal size. So far, I seem to be at a loss trying to figure out how to produce a similar animation with core animation. Anyone have any suggestions or pointers?

Thanks in advance!


I have developed a custom callout bubble that is nearly identical to the system callout bubble, but gives more flexibility over the height and content. See my post on the Asynchrony Solutions blog for example code. It also details the steps to animate the callout using Core Animation so that it appears to pop out of the map pin. It involves an affine transform that scales and translates the view.


I found a decent solution for this one. The ftutils library provides a pop in animation. It's really easy to call too:

#import "FTAnimation.h"

[self.viewToAnimate popIn:.4 delegate:nil];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜