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

标签 ios ios5 mapkit

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

相关文章:

ios - swift tableview.scrollToRow() 卡住 ui

iOS MMDrawerController objective-c 登录 View Controller

ios - Swift 4 insertTimeRange 添加视频轨道但播放时除了第一个不显示

objective-c - 加载 View 之前,应用程序崩溃iOS> 6

ios - 是否可以在 ios 的 mapView 上集群 MKPolygon

ios - 从 MKPlacemark 创建 MKMapItem 时,MKMapitem 的 Placemark.name 为 nil

ios - 将视频保存到 DocumentsDirectory

ios - ASIHTTPRequest 给我 27 个错误

ios - 在上传到Web服务器之前,如何旋转UIImagePickerController中的视频

ios - 设置新区域时,iOS 模拟器会自动显示通知