开发者

Custom MKAnnotation Image goes back to default when I attempt to drag

开发者 https://www.devze.com 2023-02-19 02:27 出处:网络
I\'ve got a bunch of MKAnnotations that don\'t need dragging.I set this by [pin 开发者_如何学编程setDraggable:NO].I\'m having an issue when I touch the annotation and (accidentally) drag off an annota

I've got a bunch of MKAnnotations that don't need dragging. I set this by [pin 开发者_如何学编程setDraggable:NO]. I'm having an issue when I touch the annotation and (accidentally) drag off an annotation, it instantly looses it's custom image and changes back to the default red pin. How do I prevent this from happening?


In the viewForAnnotation delegate method, make sure the view is created as an MKAnnotationView and not an MKPinAnnotationView (which is a subclass of MKAnnotationView that automatically provides a pin image).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号