私はUIBezierPathを使って進行円弧を作成しようとしています。完全円の周りを一周して、正しい進行に達するとアニメーションが完成します。だから本質的にそれは完全な360度を行う必要がありますが、それまではその進歩を満たすために行く必要があります行く。今のところ私はそうのようなその終了角度に行くためにそれをアニメーション化することができますCircle Progress Barのアニメーションを作成する
CABasicAnimation *drawAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
drawAnimation.duration = 2.0; // "animate over 10 seconds or so.."
drawAnimation.repeatCount = 1.0; // Animate only once..
// Animate from no part of the stroke being drawn to the entire stroke being drawn
drawAnimation.fromValue = [NSNumber numberWithFloat:0.0f];
drawAnimation.toValue = [NSNumber numberWithFloat:1.0f];
// Experiment with timing to get the appearence to look the way you want
drawAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
// Add the animation to the circle
static dispatch_once_t once;
dispatch_once(&once,^{
[progressArc addAnimation:drawAnimation forKey:@"drawCircleAnimation"];
});
は、どのように私は私のアークが、それはすべての方法の周りになり、正しい終了角度で停止ようにアニメーション化することができますか?
"本質的に360度完全にしなければならないが、遠くに行くと進歩を遂げる必要がある"しかし、これを行うにはどうすればできるだろうか?例えば、赤い円が完全な円に描かれ、次に_進む場合、あなたはすでに赤いところに赤を追加しているだけです。単一の完全な円より多くを見ることはできません。 – matt