我创建了一个bezierpath并将其添加到cashapelayer但我无法改变路径的颜色
//创建路径
UIBezierPath *graphPath = [[UIBezierPath alloc]init];
[graphPath setLineWidth:30];
[[UIColor blackColor] setStroke];
[graphPath moveToPoint:CGPointMake(30 , 30)];
[graphPath addLineToPoint:CGPointMake(30,600)];
[graphPath addLineToPoint:CGPointMake(380, 600)];
//添加图层
的路径CAShapeLayer *graphLayout = [CAShapeLayer layer];
graphLayout.frame = CGRectMake(0, 65, VIEW_WIDTH, VIEW_HEIGHT);
graphLayout.fillColor = [[UIColor clearColor] CGColor];
graphLayout.strokeColor = [UIColor redColor].CGColor;
graphLayout.lineWidth = 2;
graphLayout.path = [graphPath CGPath];
[self.layer addSublayer:graphLayout];
//animation
drawAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
drawAnimation.duration = 3;
drawAnimation.repeatCount = 1.0;
drawAnimation.fromValue = [NSNumber numberWithFloat:0.0f];
drawAnimation.toValue = [NSNumber numberWithFloat:1.0f];
[graphLayout addAnimation:drawAnimation forKey:@"drawCircleAnimation"];