CoreAnimation 虚线的设置 。ineDashPattern ,虚线设置,为一个数组,数组中奇数位实线长度,偶数位带遍空白长度。注意最好是偶数否则你看着这个效果不规则。
CAShapeLayer * oval = [CAShapeLayer layer];
oval.frame = CGRectMake(187.3, 88.5, 151, 151);
oval.lineJoin = kCALineJoinRound;
oval.fillColor = [UIColor colorWithRed:0.922 green: 0.922 blue:0.922 alpha:1].CGColor;
oval.strokeColor = [UIColor colorWithRed:0.329 green: 0.329 blue:0.329 alpha:1].CGColor;
oval.lineWidth = 9;
oval.lineDashPattern = @[@10, @5];
oval.lineDashPhase = 57.5;
oval.path = [self ovalPath].CGPath;
lineDashPhase 虚线开始的位置,当你这个值逐渐递增时候你会看到一个滚动效果,且大于0.