gpt4 book ai didi

iOS:MKPinAnnotationView 动画放置不起作用

转载 作者:行者123 更新时间:2023-11-29 04:32:31 28 4
gpt4 key购买 nike

我有以下代码可以在我的 map 中删除并添加新图钉:

- (IBAction)setLocation:(id)sender{

NSMutableArray *toRemove = [NSMutableArray arrayWithCapacity:1];
for (id annotation in map.annotations)
if (annotation != map.userLocation)
[toRemove addObject:annotation];
[map removeAnnotations:toRemove];


MKPointAnnotation *annotationPoint = [[[MKPointAnnotation alloc] init]autorelease];
annotationPoint.coordinate = map.userLocation.coordinate;
annotationPoint.title = @"Position";
[map addAnnotation:annotationPoint];

MKPinAnnotationView *pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotationPoint reuseIdentifier:@"Pin"] autorelease];
pinView.pinColor = MKPinAnnotationColorRed;
pinView.canShowCallout = YES;
//pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.animatesDrop = TRUE;


}

但我设置了我的引脚,它不执行动画,但我设置了 animatesDrop = true,为什么?

最佳答案

看来您没有将 pinView 添加到 map 中。

关于iOS:MKPinAnnotationView 动画放置不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11531866/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com