iPhone核心位置:当地图类型更改时,自定义图钉图像会消失 [英] iPhone Core Location: Custom pin image disappears when map type changes

查看:104
本文介绍了iPhone核心位置:当地图类型更改时,自定义图钉图像会消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分段控制器,它位于MKMapView上。当我更改MKMapType时,我的自定义引脚的图像将恢复为默认的红色。标题和副标题以及坐标保持不变。任何人都可以对可能的解决方案有所了解吗?

I have a segmented controller which sits on a MKMapView. When I change MKMapType, the image of my custom pins revert to the default red. The title and subtitle, along with coordinates remain intact. Can anyone shed some light on a possible solution?

推荐答案

我前一段时间遇到过类似的问题。

I had a similar problem a while ago.

为什么定制的MKMapView注释图像会在触摸时消失?

确保您使用 MKAnnotationView 而不是 MKPinAnnotationView 您的 viewForAnnotation 方法无处不在。

Make sure you're using MKAnnotationView instead of MKPinAnnotationView everywhere in your viewForAnnotation method.

这篇关于iPhone核心位置:当地图类型更改时,自定义图钉图像会消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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