0

我对旋转的图像有疑问。

CATransform3DMakeRotation(M_PI, 0, 0, -1.0)如果我使用图层制作动画,则在旋转图像时将显示锯齿状(摇动)图像。

backgroundView 被添加到另一个动画视图中(与 backgroundView 相同,但方向相反)。

代码是:

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI , 0, 0, -1.0)];
animation.duration = 30;
animation.cumulative = YES;
animation.repeatCount = INT_MAX;
[backgroundView.layer addAnimation:animation forKey:@"animationOne"];

感谢您的时间。

4

1 回答 1

0

问题已修复,使用该功能可以去除图像旋转时的锯齿。

[self.layer setShouldRasterize:YES];
于 2011-07-26T03:30:50.387 回答