[mapView selectAnnotation]时有时出现奇怪的神器; [英] Sometimes strange artifact appears when [mapView selectAnnotation];

查看:397
本文介绍了[mapView selectAnnotation]时有时出现奇怪的神器;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[_mapView selectAnnotation:sannotation animated:YES];

它似乎并不总是如此,所以我不明白它的原因是什么。

It appears not always, so I don't understand what's the reason for it.

如何解决?

推荐答案

在选择任何注释之前,请取消选择mapView上的所有注释。

Before selecting any annotation deselect all annotations on mapView.

for (id<MKAnnotation> annotation in mapView.annotations) 
  [mymap deselectAnnotation:annotation animated:NO];

我在使用默认标注时遇到了同样的问题,我实施了自定义标注。虽然它不是一个完美的解决方案,但却达到了目的。

I had same issue when along with default callout, I had implemented custom callouts. Though it is not a perfect solution it served the purpose.

这篇关于[mapView selectAnnotation]时有时出现奇怪的神器;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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