小编afc*_*old的帖子

MKAnnotationView拖动状态结束动画

我正在使用Daniel提供的自定义MKAnnotationView动画:子类化MKAnnotationView并覆盖setDragState但我遇到了一个问题.

在引脚放置动画之后,当我去移动地图时,mkannotationview会在调用最终引脚放置动画块之前跳回到之前的位置.

在我看来,在动画运行之前调用了dragState = MKAnnotationViewDragStateEnding?如何绕过这个问题并将mkannotationview的最终点设置为动画结束时的点?

#import "MapPin.h"

NSString *const DPAnnotationViewDidFinishDrag = @"DPAnnotationViewDidFinishDrag";
NSString *const DPAnnotationViewKey = @"DPAnnotationView";

// Estimate a finger size
// This is the amount of pixels I consider
// that the finger will block when the user
// is dragging the pin.
// We will use this to lift the pin even higher during dragging

#define kFingerSize 20.0

@interface MapPin()
@property (nonatomic) CGPoint fingerPoint;
@end

@implementation MapPin
@synthesize dragState, fingerPoint, mapView;

- (void)setDragState:(MKAnnotationViewDragState)newDragState animated:(BOOL)animated
{ …
Run Code Online (Sandbox Code Playgroud)

mapkit mkannotationview uiviewanimation ios

1
推荐指数
1
解决办法
1283
查看次数

标签 统计

ios ×1

mapkit ×1

mkannotationview ×1

uiviewanimation ×1