ios - 按比例缩小时,视图会像素化

时间:2013-08-27 20:15:09

标签: ios uiview uiimageview cgaffinetransform cabasicanimation

我有一个由两个UIImageViews组成的UIView。它们是同心圆形状。当我像这样缩放此视图时:

CABasicAnimation *resizeAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
    resizeAnimation.fromValue = [NSNumber numberWithDouble:1.0];
    resizeAnimation.toValue = [NSNumber numberWithDouble:0.25];
    resizeAnimation.fillMode = kCAFillModeForwards;
    resizeAnimation.removedOnCompletion = NO;

缩小时,图像的边缘变得粗糙并且像素化。我有什么办法可以防止这种情况或至少减少它吗?

1 个答案:

答案 0 :(得分:0)

尝试将图片视图的图层minificationFilter设置为kCAFilterNearest或kCAFilterTrilinear