【发布时间】:2015-10-12 06:00:01
【问题描述】:
我有基本的 UILabel,它使用 CACAKeyframeAnimation 沿着一个完整的圆圈制作动画:
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddArc(path,nil, center.x,center.y, radius , DEGREES_TO_RADIANS(from_degree), DEGREES_TO_RADIANS((360+from_degree)), NO);
CAKeyframeAnimation *theAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
theAnimation.path = path;
CGPathRelease(path);
// set the animation properties
theAnimation.duration = duration;
theAnimation.removedOnCompletion = NO;
theAnimation.fillMode = kCAFillModeBoth;
theAnimation.repeatCount = INFINITY;
theAnimation.calculationMode = kCAAnimationPaced;
[label.layer addAnimation:theAnimation forKey:@"position"];
有没有办法为圆弧的半径变化设置动画并将该变化传播到沿路径移动的标签?
【问题讨论】:
标签: ios objective-c core-animation caanimation