如何检测 MKAnnotation 何时被点击

发布于 2024-12-01 15:11:05 字数 86 浏览 5 评论 0原文

我有一个地图视图,它显示许多引脚(MKAnnotation 对象)。我想通过点击(单击)来获取每个引脚的详细信息。请参考一些教程或提供一些示例代码。提前致谢。

i have a mapView, which shows many pins (MKAnnotation objects). i want to get the detail of each pin by tapping (clicking ) on it. please refer me to some tutorials or provide some sample code. thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

披肩女神 2024-12-08 15:11:05

如果正确实现 MKAnnotation 协议,点击应该自动显示“标题”和“副标题”成员,即不需要任何额外的编码。

看看我刚刚创建的 Speedy 的 MKMapView 示例,或者直接下载它位于此处

有关获得委托点击的更多信息,请查看帖子

If you implement the MKAnnotation protocol correctly, tapping should display the "title" and "subtitle" members automatically, i.e. without the need for any additional coding.

Take a look at this MKMapView sample for Speedy I just created, or simply download it here.

For further information about getting the click to your delegate take a look at this post

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文