0
UIScrollView
에 UIBezierPath
을 그려야합니다. 시작점에서 끝점까지 경로를 그리는 애니메이션을 만들었지 만, 원하는 애니메이션이 아닙니다.UIBezierPath 펄스 애니메이션
UIBezierPath *linePath = [UIBezierPath bezierPath];
[linePath moveToPoint:startPoints];
[linePath addLineToPoint:endPoints;
//shape layer for the line
CAShapeLayer *line = [CAShapeLayer layer];
line.path = [linePath CGPath];
// line.fillColor = [[UIColor blackColor] CGColor];
line.strokeColor = [[colors objectAtIndex:i] CGColor];
line.lineWidth = 5;
// line.contents = (id)[[UIImage imageNamed:@"Mask.png"] CGImage];
// line.contentsGravity = kCAGravityCenter;
CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
pathAnimation.duration = 3.0;
pathAnimation.fromValue = @(0.0f);
pathAnimation.toValue = @(1.0f);
pathAnimation.repeatCount = HUGE_VAL;
[line addAnimation:pathAnimation forKey:@"strokeEnd"];
나는 contents
에 모양 레이어를 추가하는 시도했지만 나는 애니메이션에 나쁜입니다. 달성하고자하는 효과는 "슬라이드 잠금 해제"와 동일한 애니메이션 또는 펄스하는 경로입니다.
나는 slide-to-unlock의 답변으로 같은 일을 시도했다하지만이 dooing 결국