如何在不触及引脚的情况下触发MKAnnotationView的标注视图? [英] How to trigger MKAnnotationView's callout view without touching the pin?

查看:98
本文介绍了如何在不触及引脚的情况下触发MKAnnotationView的标注视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用通常的彩色引脚作为位置点 MKMapView 。我希望能够在不触及销钉的情况下显示标注。

I'm working on a MKMapView with the usual colored pin as the location points. I would like to be able to have the callout displayed without touching the pin.

我该怎么做?在annotationview上调用 setSelected:YES 什么也没做。我正在考虑模拟针上的触摸,但我不知道该怎么做。

How should I do that? Calling setSelected:YES on the annotationview did nothing. I'm thinking of simulate a touch on the pin but I'm not sure how to go about it.

推荐答案

好的,这是这个问题的解决方案。

Ok, here's the solution to this problem.

要显示标注,请使用 MKMapView selectAnnotation :动画方法。

To display the callout use MKMapView's selectAnnotation:animated method.

这篇关于如何在不触及引脚的情况下触发MKAnnotationView的标注视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆