问题描述
我正在尝试隐藏MapKit视图上的图钉,并将隐藏
属性设置为 YES
工作,我仍然可以点击它并获得 didSelectAnnotationView
消息!当然,我尝试将 userInteractionEnabled
设置为否
,但我仍然收到消息。
I'm trying to hide a pin on a MapKit view, and while setting the hidden
property to YES
works, I can still tap on it and get didSelectAnnotationView
messages!. Naturally, I tried setting userInteractionEnabled
to NO
, but I'm still receiving the messages.
这就是我尝试过的。 a
是我的注释视图。
This is what I've tried. a
is my annotation view.
a.hidden = YES;
a.layer.hidden = YES;
a.userInteractionEnabled = NO;
这里有一些我不知道的东西,我到处搜索,找不到任何东西这样可行。有什么线索吗?
There's something that I'm missing here, and I've Googled everywhere and can't find anything that works. Any clues?
推荐答案
已启用
属性 MKAnnotationView
可以设置为否
以禁用选择声明:
The enabled
property of MKAnnotationView
can be set to NO
to disable selection as the documentation states:
这篇关于在MapKit引脚上隐藏和禁用用户交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!