问题
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?
回答1:
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).
来源:https://stackoverflow.com/questions/5373265/custom-mkannotation-image-goes-back-to-default-when-i-attempt-to-drag