小编Bil*_*ani的帖子

UIBezierPath圈获得特定点

我想绘制一个大圆圈并放置一些较小的圆圈,如下图所示

圈

我绘制了大卷 - (void)drawRect:(CGRect)rect

CGFloat rectX = self.frame.size.width / 2;
CGFloat rectY = self.frame.size.height / 2;

CGFloat width = self.frame.size.width-30;
CGFloat height = self.frame.size.width -30;

CGFloat centerX = rectX - width/2;
CGFloat centerY = rectY - height/2;


UIBezierPath *bezierPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(centerX, centerY, width, height)];

[[UIColor blackColor] set];
[bezierPath stroke];
Run Code Online (Sandbox Code Playgroud)

让我们说我想在圆上找到10个等间距的点,以绘制10个较小的红色圆圈.有智能解决方案吗?先感谢您.

core-graphics uikit ios uibezierpath

1
推荐指数
1
解决办法
1203
查看次数

标签 统计

core-graphics ×1

ios ×1

uibezierpath ×1

uikit ×1