[英]iPhone Core Location: Custom pin image disappears when map type changes
I have a segmented controller which sits on a MKMapView. 我有一个分段控制器,它位于MKMapView上。 When I change MKMapType, the image of my custom pins revert to the default red. 当我更改MKMapType时,我的自定义引脚的图像将恢复为默认的红色。 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. 我刚才有类似的问题。
Why does a custom MKMapView annotation image disappear on touch? 为什么自定义MKMapView注释图像在触摸时会消失?
Make sure you're using MKAnnotationView
instead of MKPinAnnotationView
everywhere in your viewForAnnotation
method. 确保在viewForAnnotation
方法中的所有位置都使用MKAnnotationView
而不是MKPinAnnotationView
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.