gpt4 book ai didi

ios - MKPointAnnotation - 默认显示标题和动画?

转载 作者:可可西里 更新时间:2023-11-01 03:37:56 25 4
gpt4 key购买 nike

在我的 viewWillAppear 中有一个 View

MKPointAnnotation *point = [[MKPointAnnotation alloc] init];

[point setCoordinate:(myLocation)];
[point setTitle:@"Here it is!"];

[mapView addAnnotation:point];

[mapView setRegion:adjustedRegion animated:YES];

这会按照我的意图将点添加到 map 中。但是我必须点击它才能看到标注。

如何让它默认显示标注?

我试着在之后添加这个: [self.mapView selectAnnotation:annotation animated:YES];

但它似乎没有用...我是否必须使用真正的注释而不是 MKPointAnnotation 来执行此操作?

最佳答案

您将注释命名为 point 而不是 annotation:

 [mapView selectAnnotation:point animated:YES];

它发生在我们最好的人身上。

关于ios - MKPointAnnotation - 默认显示标题和动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9520205/

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