CAShapeLayer *lineShape = nil;
CGMutablePathRef linePath = nil;
linePath = CGPathCreateMutable();
lineShape = [CAShapeLayer layer];
[lineShape setLineWidth:4.0f];
[lineShape setLineCap:kCALineCapRound];
[lineShape setStrokeColor:[[UIColor whiteColor] CGColor]];
CGPathMoveToPoint(linePath, NULL, 0, 0);
CGPathAddLineToPoint(linePath, NULL, 0, 44);
lineShape.path = linePath;
[cell.layer addSublayer:lineShape];
CGPathRelease(linePath); //----------必须释放掉
iOS 画线
最新推荐文章于 2021-01-12 09:31:55 发布