使用 MKCircle 自定义注释视图
我正在尝试为我拥有的自定义 MKAnnotation 制作自定义视图。我想要的是一个实心圆圈,里面有一个数字,颜色取决于该数字的值。该数字的值将从我的自定义 MKAnnotation 类中获取。我目前将注释视图作为地图图钉,并且为其分配了标注方法等,因此我希望我的新视图的功能与此图钉视图相同。我该怎么办呢?我似乎找不到任何教我如何执行此操作的内容:我是否必须将圆圈创建为叠加层并在地图视图控制器中处理绘图?
I am trying to make a custom view for a custom MKAnnotation I have. What I want is a solid circle with a number inside, and a colour depending on what the value of that number is. The number's value will be taken from my custom MKAnnotation class. I currently have the annotation view as a map pin, and I have a callout method assigned to it etc. so I want my new view to function the same as this pin view. How would I go about this? I can't seem to find anything that teaches me how to do this: would I have to create the circle as an overlay and handle the drawing in the map view controller?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论