我有一个 CALayer,在其最终尺寸上画了一个圆圈。我想为圆圈设置动画,使其以 1% 的比例开始并以 100% 的比例结束。现在动画不是很平滑,因为在缩放时边缘会闪烁。在最终尺寸下,圆圈看起来是正确的。我想知道是否有办法在动画本身期间进行抗锯齿。
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"];