【发布时间】:2011-05-31 13:27:22
【问题描述】:
我有一个UIImageView,我需要在屏幕外设置动画。我通过在 1 秒的动画块中将帧调整为 0 来做到这一点。如果我不考虑作为缩放类型之一的内容类型,它会按照我的意愿缩小到 0,但它会在调整到新的帧大小时挤压图像。 我需要它来剪掉底部。我将内容类型更改为左上角,这导致它不执行任何操作。
我在这里想念什么?
这是动画块代码。
// Change frame height.
[UIView animateWithDuration:1.0f
animations:^ {
// Animate the frame off the screen
_closeImage.frame = CGRectMake(_closeImage.frame.origin.x, _closeImage.frame.origin.y, _closeImage.frame.size.width, 0);
}
];
【问题讨论】:
-
内容类型是什么意思?
-
他的意思是缩放模式。 @btate,尝试其他 scaleModes。
标签: iphone ios ipad uiview uiimageview