我有一個使用MKCircle
s到顯示用於特定用戶操作半徑的信息的MapView類。如何添加觸摸手勢來映射但忽略引腳和註釋的觸摸?
我想要做的,是讓用戶關閉該MKCircle
,當他們接觸到的地圖。不過,我希望MKCircle
不要解僱,如果用戶觸摸任何其他引腳或MKCircle
本身。
任何想法?
這裏是我當前的代碼,其中駁回時地圖的任何部分觸及MKCircle
:
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(deactivateAllRadars)];
[tap setCancelsTouchesInView:NO];
[_mapView addGestureRecognizer:tap];
完美的作品! – JimmyJammed
它不適用於iOS 7,在命中測試中返回MKNewAnnotationContainerView。任何想法如何解決它? –
@RodrigoRuiz,MKNewAnnotationContainerView(私有類)是當你在地圖上面積這個特殊的代碼_doesn't護理about_挖掘什麼返回。當你點擊一個註解時,iOS 7仍然返回代碼_正在檢查for_的MKAnnotationView(記錄類)。如果還有問題,請詳細說明一個新問題。 – Anna