1. 矩形 UIBezierPath *path1 = [UIBezierPath bezierPathWithRect:CGRectMake(50, 50, 200, 100)]; | ||||||||||||||||||||||||||
2. 圆角矩形 UIBezierPath *path2 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(50, 50, 200, 100) cornerRadius:20]; | ||||||||||||||||||||||||||
3. 椭圆 UIBezierPath *path3 = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 180, 200, 100)]; | ||||||||||||||||||||||||||
4. 圆弧 UIBezierPath *path4 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(160, 160) radius:100 startAngle:M_PI_2*3 endAngle:0 clockwise:YES]; | ||||||||||||||||||||||||||
[path5 addArcWithCenter:CGPointMake(160, 160) radius:100 startAngle:M_PI_2*3 endAngle:0 clockwise:YES]; | ||||||||||||||||||||||||||
4. 直线 UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(40, 40)]; [path addLineToPoint:CGPointMake(40, 140)]; [path addLineToPoint:CGPointMake(140, 140)]; path.lineWidth = 20; path.lineCapStyle = kCGLineCapSquare; path.lineJoinStyle = kCGLineJoinBevel; [[UIColor greenColor] setFill]; [[UIColor redColor]setStroke]; [path stroke]; [path fill]; | ||||||||||||||||||||||||||
5. 绘制字符串
|