这可能看起来像是一个新手问题,但我想从特定高度的两点画一条线
我已经完成了这个
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(point1.x,point1.y)];
[path addLineToPoint:CGPointMake(point2.x,point2.y)];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = [path CGPath];
shapeLayer.strokeColor = [[UIColor greenColor] CGColor];
shapeLayer.lineWidth = 0.5;
shapeLayer.fillColor = [[UIColor clearColor] CGColor];
[view.layer addSublayer:shapeLayer];
修改:
例如,见上图:我想延长垂直线(下嘴唇到上嘴唇点)但我只有两个点1.下唇点和2.嘴中心点。 。 。