开发者

Custon MKPinAnnotationColor

开发者 https://www.devze.com 2022-12-21 23:20 出处:网络
I have searched a bit on google, but didn\'t really found an answer to my question. I want to create a pin with a different color, e.g. yellow or orange.

I have searched a bit on google, but didn't really found an answer to my question. I want to create a pin with a different color, e.g. yellow or orange.

How should I do this? It seems that it's not possible to create one sending a UIColor开发者_如何学Go to it. Should I design them myself and somehow change the pin to an own image?

Best regards, Paul Peelen


Yes you have to do it yourself with your custom MKAnnotationView, I posted some customs colors I did on my own there :

MKPinAnnotationView: Are there more than three colors available?


The 3 pin "colors" are actually series of different images (look in your iPhoneSimulator3.0.sdk/System/Library/Frameworks/MapKit.framework), so you can't create one by sending a UIColor.

You need to make a custom MKAnnotationView...

0

精彩评论

暂无评论...
验证码 换一张
取 消