在我的 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/