【发布时间】:2015-05-26 12:32:28
【问题描述】:
我想画一个大圆圈并放置一些较小的圆圈,如下图所示
我在 - (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];
假设我想在圆上找到 10 个等距点,以绘制 10 个较小的红色圆圈。有什么聪明的解决办法吗?提前谢谢你。
【问题讨论】:
标签: ios uikit core-graphics uibezierpath