Ios 线后画不同的形状
我正在使用核心图形绘制线条。我想在(半圆)完成线条后附加不同的形状。同样,在半圆之后,我想绘制线条。下面是代码:Ios 线后画不同的形状,ios,cgcontext,Ios,Cgcontext,我正在使用核心图形绘制线条。我想在(半圆)完成线条后附加不同的形状。同样,在半圆之后,我想绘制线条。下面是代码: -(void)drawRect:(CGRect)rect { // Drawing code CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextMoveToPoint(context, 0, 10); C
-(void)drawRect:(CGRect)rect { // Drawing code
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGContextMoveToPoint(context, 0, 10);
CGContextAddLineToPoint(context, 100, 10.0);
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
CGRect rectangle = CGRectMake(0,75,100,30);
CGContextAddEllipseInRect(context, rectangle);
CGContextStrokePath(context);
}
请帮帮我。谢谢你。提示也将受到欢迎。要绘制的路径可以从许多不同的部分构建,当前您可以移动到起点,并使用
CGContextAddLineToPoint
绘制一条直线,但您可以使用相同的功能添加更多直线,并使用CGContextAddArcToPoint
(中还介绍了其他几个选项)。超级伟恩先生(黑夜:D)。。。