【发布时间】:2011-07-28 21:42:13
【问题描述】:
myImageView:
[UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionCurveLinear
animations:^{
}
completion:^(BOOL finished) {
}
];
如何使用动画块为myImageView(位置/比例)设置动画?
【问题讨论】:
myImageView:
[UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionCurveLinear
animations:^{
}
completion:^(BOOL finished) {
}
];
如何使用动画块为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
【讨论】: