How to resize the custom annotation pin image in MKMapView?

北慕城南 提交于 2019-12-25 03:51:27

问题


I am using swift 4. I have added MKMapView with some pins but I need to resize the pin image based on the map zooming.

So if anyone knows, how to resize the image based on map zooming?


回答1:


You can't. Pins always say a constant size as the user zooms the map.

You'll want to look into using a MKOverlay and possibly a custom MKOverlayRenderer subclass. That will allow you to draw content that grows and shrinks as the user zooms in and out.



来源:https://stackoverflow.com/questions/52782144/how-to-resize-the-custom-annotation-pin-image-in-mkmapview

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