复制辐射圆,例如 MKMapView 上的用户位置
是否可以有像用户位置注释那样的放射状圆圈。这样自定义注释就有其他颜色的放射状圆圈。如果没有,是否有一种破解方法可以使其工作?
Is it possible to have the radiating circles like the user location annotation. So that custom annotations have radiating circles of other colors. If not is there a hack way to make it work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看这个。您也许可以用它来做您需要做的事情。结合使用核心动画和子类化
MKCircleView
或MKOverlayView
。http://yickhong-ios.blogspot.com/2012 /04/animated-circle-on-mkmapview.html
Check this out. You may able to do what you need with that. With a combination of using Core Animation and subclassing
MKCircleView
orMKOverlayView
.http://yickhong-ios.blogspot.com/2012/04/animated-circle-on-mkmapview.html
可以创建 UIView 的自定义子类来执行此操作。具有两个子层的 UIView,一个用于中心球,一个用于扩展环。环形层和球层可以通过子类化 CALayer 并重写drawInContext:来创建,这样你就可以获得你想要的任何颜色。为环设置动画以便它们同时展开和淡出的代码可以使用如下所示的 CAAnimationGroup:
It is possible to create a custom subclass of UIView that does this. A UIView with two sublayers, one for the center ball and one for the expanding rings. The ring layer and the ball layer can be created by subclassing CALayer and overriding drawInContext: so you can get any colors you want. Code to animate the rings so that they expand and fade out at the same time could use a CAAnimationGroup like this: