自动“canShowCallOut”注释 iPhone
我可以通过什么方式调用自动打开注释(带有标题、副标题等)的函数,而不是触摸地图视图上的注释?
In which way could I call the function that automatically opens my annotation (with title, subtitle, etc), rather than to touch on the annotation on the mapview?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实现 MKMapViewDelegate 委托;
实现
- (MKAnnotationView *)mapView: (MKMapView *)mapView_viewForAnnotation:(id)annotation_;
;例如,如下所示:地图加载完成后显示图钉:
此代码有一个名为注释的属性,它实现了
MKAnnotation
。另外,它也会制作针掉落的动画,但它应该是相当不言自明的。HTH。
Implement
MKMapViewDelegate
delegate;Implement
- (MKAnnotationView *) mapView: (MKMapView *) mapView_ viewForAnnotation: (id <MKAnnotation>) annotation_;
; for example like this:Show the pin after the map has finished loading:
This code has a property called annotation which implements
MKAnnotation
. Also, it animates the pin drop too, but it should be fairly self-explaining.HTH.
阿方斯回答了这个问题,但如果您正在寻找自动打开标注的确切内容,那就是这部分:
Alfons answered the question but if you are looking for what exactly automatically opens the callout, it's this part: