Custom MKPinAnnotationView Colours

无人久伴 提交于 2019-12-25 04:52:41

问题


Is it possible to define custom colours for the MKPinAnnotationView colour rather than the default red, green or purple? Docs say no...

Thanks


回答1:


    If you want to use annotation with color different from standard ones you should create your own image.
    If Apple's docs say no, you should trust them - even if there's undocumented (using private api) way to do something it will likely cause your app to be rejected from app store.




回答2:


Yep. It is possible and doesn't involve any undocumented APIs:

MKPinAnnotationView: Are there more than three colors available?



来源:https://stackoverflow.com/questions/1847123/custom-mkpinannotationview-colours

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