我有一個CALayer,其最終大小繪製了一個圓。我想讓這個圈子動起來,以1%的比例開始,並以100%結束。現在動畫不是很平滑,因爲邊緣在縮放時閃爍。在最終尺寸的圓圈看起來是正確的。我想知道是否有一種方法可以在動畫本身中進行消除鋸齒。在CALayer上動畫「轉換」屬性時進行抗鋸齒?
CATransform3D fromTransform = CATransform3DMakeScale(0.01, 0.01, 1.0);
CATransform3D toTransform = CATransform3DMakeScale(1.0, 1.0, 1.0);
CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
theAnimation.duration = 1.5;
theAnimation.fromValue = [NSValue valueWithCATransform3D:fromTransform];
theAnimation.toValue = [NSValue valueWithCATransform3D:toTransform];
[myLayer addAnimation:theAnimation forKey:@"animateScale"];
謝謝您的輸入。我有這樣的感覺。我在iPhone上這樣做,所以過濾器不可用。我會嘗試一幀一幀的方法。有關使用線程的好建議! – anna 2010-07-24 20:14:58