MKAnnotationView - Lock custom annotation view to pin on location updates

后端 未结 3 1931
灰色年华
灰色年华 2020-11-27 03:06

Update #5 I guess it\'s bounty time. 100+ views and no one\'s taken a stab, even with the code sample I\'ve posted. How about some reputation points!

3条回答
  •  [愿得一人]
    2020-11-27 03:38

    I know you aren't going to like this answer, but it works. The sample you linked to just draws a custom image in the overlay through the most difficult way possible (drawRect:). Have you considered rendering your overlay once into a UIImage, and just setting the image property on a very simple MKAnnotationView? Even if you need to change the content periodically, like updating the number of friends at a bar, you can redraw the image when the change occurs and update the appropriate MKAnnotationView.

提交回复
热议问题