How do I make a MKAnnotationView touch sensitive?

前端 未结 4 1131
-上瘾入骨i
-上瘾入骨i 2020-12-05 16:07

I currently have a map view with some annotation on it. I have the annotation with custom images. The problem I am trying to fix is the sensitivity of the images. When I try

4条回答
  •  旧巷少年郎
    2020-12-05 16:49

    I implemented something similar in the following manner

    1. Create a subclass of the Gesture Recognizer class that handles touches
    2. Create a subclass of the UIImage class, this class uses the recognizer class to handle your gestures
    3. Use this in the annotation

    The gesture recognizer subclass will handle your gestures if you perform them at any point in the image. This should help you.

    Keep us updated on whether this solution worked for u...

提交回复
热议问题