Custon MKPinAnnotationColor

发布于 2024-08-23 09:50:02 字数 143 浏览 4 评论 0原文

我在谷歌上搜索了一下,但没有真正找到我的问题的答案。 我想创建一个不同颜色的图钉,例如黄色或橙色。

我该怎么做?似乎不可能创建一个向其发送 UIColor 的对象。我应该自己设计它们并以某种方式将图钉更改为自己的图像吗?

此致, 保罗·皮伦

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 to it. Should I design them myself and somehow change the pin to an own image?

Best regards,
Paul Peelen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

避讳 2024-08-30 09:50:02

是的,您必须使用自定义 MKAnnotationView 自行完成,我在那里发布了一些我自己做的自定义颜色:

MKPinAnnotationView:是否有超过三种颜色可用?

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?

玩物 2024-08-30 09:50:02

3 个引脚“颜色”实际上是一系列不同的图像(查看您的 iPhoneSimulator3.0.sdk/System/Library/Frameworks/MapKit.framework),因此您无法通过发送用户界面颜色。

您需要制作一个自定义 MKAnnotationView...

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文