MKMapView叠加层上的触摸事件 [英] Touch events on MKMapView's overlays

查看:92
本文介绍了MKMapView叠加层上的触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我目前正在设计的应用中,我有一个带有覆盖层的MKMapView(自定义MKPolylines btw),我希望能够检测这些覆盖层上的触摸事件,并为每个覆盖层分配特定的操作.有人可以帮我吗? 谢谢!

In the app I'm currently designing I have a MKMapView with overlays on it (customized MKPolylines btw) and I would like to be able to detect touch events on these overlays and assign a specific action to each overlay. Could any one help me on this one ? Thanks !

Benjab

推荐答案

以防万一,它可能对某些人有所帮助... 我找不到办法,但是我在叠加层上添加了注释(无论如何,我需要这样做以显示一些信息),然后我可以在该注释上获得touch事件.我知道这不是最好的方法,但是在我的情况下,也许在您的情况下,它是有效的;)!

Just in case it might help some of you... I couldn't find a way to do that but I added an annotation on my overlays (Anyway, i needed to do that to display some information) and then I could get the touch event on this annotation. I know it is not the best way to do it but in my situation, and maybe yours, it works ;) !

这篇关于MKMapView叠加层上的触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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