问题描述
|
我有一些代码需要在
UIView
动画括号内运行,但我希望将其免于动画处理,因此其两边的所有代码均已动画处理,但不是。有没有办法做到这一点?
解决方法
没有代码可以插入到UIView动画块中以将其从动画中排除,但是您可以嵌套UIView动画和完成块以用于任意复杂的动画链:
[UIView animateWithDuration:0.3f animations:^ {
// Animation Code.
} completion: ^ (BOOL finished) {
// Non-animated code,executed after first animation block...
// Blah;
// [Blah blah];
[UIView animateWithDuration:0.3f animations:^ {
// More animation code.
}];
}];
, 这似乎是这样的:
[UIView performWithoutAnimation:^{
view.frame = CGRectMake(...);
}];