您的位置:首页 > 产品设计 > UI/UE

iOSUIBezierPath

2016-02-17 14:41 375 查看
1.创建贝塞尔曲线
+ (UIBezierPath *)bezierPath;

//创建UIBezierPath
UIBezierPath *path = [UIBezierPath bezierPath];

2.创建矩形

+ (UIBezierPath *)bezierPathWithRect:(CGRect)rect;

3.使用UIBezierPath创建圆形或者椭圆形:正方形是圆。长方形是椭圆
+ (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect;
4.创建圆角矩形

+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius

5.任意角弧度

+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect byRoundingCorners:(UIRectCorner)corners
cornerRadii:(CGSize)cornerRadii;

6.创建一个弧线

+ (UIBezierPath *)bezierPathWithArcCenter:(CGPoint)center radius:(CGFloat)radius
startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise;

7.初始线段的起点

- (void)moveToPoint:(CGPoint)point;
8.添加线上的点

- (void)addLineToPoint:(CGPoint)point

9.//以三个点画一段曲线,一般和moveToPoint配合使用

- (void)addCurveToPoint:(CGPoint)endPoint controlPoint1:(CGPoint)controlPoint1 controlPoint2:(CGPoint)controlPoint2

ndPoint:曲线的终点

controlPoint1:画曲线的第一个基准点

controlPoint2:画曲线的第二个基准点
10.//画二元曲线,一般和moveToPoint配合使用

- (void)addQuadCurveToPoint:(CGPoint)endPoint controlPoint:(CGPoint)controlPoint;

参数:

endPoint:曲线的终点

controlPoint:画曲线的基准点
11.
12.

关闭path,这个方法会自动连接最后点和起始点

画圆弧

- (void)closePath;
13。删除所有的点

- (void)removeAllPoints;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: