简体   繁体   English

在 iOS 中,有没有一种方法可以让按钮围绕弧线或圆移动?

[英]In iOS, is there a method to make a button move around arc line or circle?

I have a custom control like the picture below, it is too complicated to draw all the images using core graphics.我有一个像下图这样的自定义控件,使用核心图形绘制所有图像太复杂了。 So I use the images designer give, but the problem is how to make the small circle(which is actually a button) on the big white circle(which is an UIImageView) move aroud the big circle?所以我使用了图片设计师给的,但问题是如何让白色大圆圈(这是一个 UIImageView)上的小圆圈(实际上是一个按钮)在大圆圈周围移动? Thanks in advance!提前致谢!

在此处输入图片说明

You need to calculate all circumference points.您需要计算所有圆周点。 Just set centre of your image to the points calculated by you.只需将图像的中心设置为您计算出的点即可。 Automatically your image will start moving in circle.您的图像将自动开始绕圈移动。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM