myImageView
:
[UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionCurveLinear
animations:^{
}
completion:^(BOOL finished) {
}
];
如何使用动画 block 对 myImageView
(位置/比例)进行动画处理?
最佳答案
您需要使用 CGAffineTransformations,如下所示:
[UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionCurveLinear
animations:^{
CGAffineTransform scale = CGAffineTransformMakeScale(2.0, 2.0);
CGAffineTransform translate = CGAffineTransformMakeTranslation(10.0, 10.0);
self.myImageView.transform = CGAffineTransformConcat(scale, translate);
}
completion:^(BOOL finished) {
}
];
这里我对 scale
和 transform
进行变换,然后使用 CGAffineTransformConcat
将它们组合起来。
文档是 here
HTH
关于iPhone SDK 4.0 动画 block - 移动缩放 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5534299/