iOS CoreAnimation教程 第四篇

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;
iOS CoreAnimation教程 第四篇_第1张图片
    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;
iOS CoreAnimation教程 第四篇_第2张图片
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;
iOS CoreAnimation教程 第四篇_第3张图片

你可能感兴趣的:(iOS CoreAnimation教程 第四篇)