CoreAnimation lineCap 属性效果直接看效果图
CAShapeLayer * path2 = [CAShapeLayer layer];
path2.frame = CGRectMake(93.5, 331.5, 186.06, 73);
path2.lineCap = kCALineCapSquare;
path2.fillColor = nil;
path2.strokeColor = [UIColor blackColor].CGColor;
path2.lineWidth = 12;
path2.path = [self path2Path].CGPath;
CAShapeLayer * path2 = [CAShapeLayer layer];
path2.frame = CGRectMake(93.5, 331.5, 186.06, 73);
path2.lineCap = kCALineCapRound;
path2.fillColor = nil;
path2.strokeColor = [UIColor blackColor].CGColor;
path2.lineWidth = 12;
path2.path = [self path2Path].CGPath;
CAShapeLayer * path2 = [CAShapeLayer layer];
path2.frame = CGRectMake(93.5, 331.5, 186.06, 73);
path2.lineCap = kCALineCapButt;
path2.fillColor = nil;
path2.strokeColor = [UIColor blackColor].CGColor;
path2.lineWidth = 12;
path2.path = [self path2Path].CGPath;
网友评论