UIBezierPath *path = [UIBezierPath bezierPath];
CGFloatvh =Get375Height(56);
[pathmoveToPoint:CGPointMake(0, 0)];
[pathaddLineToPoint:CGPointMake(0, vh)];
[pathaddLineToPoint:CGPointMake(kScreenWidth, vh)];
[pathaddLineToPoint:CGPointMake(kScreenWidth, vh/3*2)];
[pathaddQuadCurveToPoint:CGPointMake(kScreenWidth - 100, vh) controlPoint:CGPointMake(kScreenWidth, vh)];
[pathaddQuadCurveToPoint:CGPointMake(0, 0) controlPoint:CGPointMake(kScreenWidth/5, vh)];
CAShapeLayer*shapLayer = [CAShapeLayerlayer];
shapLayer.path= path.CGPath;
self.bezierView.layer.mask= shapLayer;
[self.view addsubview : self.bezierView];
注解: [pathaddQuadCurveToPoint:CGPointMake(0, 0) controlPoint:CGPointMake(kScreenWidth/5, vh)];
CurveToPoint是终点 起点在上一个终点 controlPoint是起点和终点的弧度的最高点或是最低点(个人是这样理解的)
大概就这样
网友评论