How do I set a custom image on an map annotation?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:29:04

问题


I want to set a custom image to a SKAnnotation but when I set the image path the markers wont appear. I set the marker image with the following code:

annotation.imagePath = [[NSBundle mainBundle] pathForResource:@"64-map-test" ofType:@"png"];
annotation.imageSize = 64;

When I use a default image:

annotation.annotationType = SKAnnotationTypeGreen;

the markers do appear correctly.

How do I set a custom image on an map annotation?


回答1:


png-8 file format is not supported. Using a png-24 file works correctly.



来源:https://stackoverflow.com/questions/23493961/how-do-i-set-a-custom-image-on-an-map-annotation

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