image markers on MKMapView

人走茶凉 提交于 2020-01-03 17:10:18

问题


Need to use own imaged markers instead built-in pins. I have several questions. 1. Is it legally? I have a doubt because there is no standard support for markers(pins) with own icon.

  1. How to make a marker with own icon right way? I found the post which actually describe how-to: http://www.arlingtondev.com/thoughts/?p=81. I am a newbie, but it looks like a "crutch", which i do not want to use in my clean code. Could you advise better way? I had a lot of problems while integrate that method and currenlty cannot move and animate icons, that's why decided to ask stackoverflowers.

回答1:


Yes, you can. Check the MKAnnotationView class, it's specifically designed for that. In fact, MKPinAnnotationView inherits from it. Use the image field to specify an image.



来源:https://stackoverflow.com/questions/1033924/image-markers-on-mkmapview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!