我使用 animateKeyframesWithDuration
为我的 View 制作简单的动画:
[UIView animateKeyframesWithDuration:1.0 delay:0.0 options:0 animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{
containerView.center = CGPointMake(containerView.center.x, 150);
}];
[UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.5 animations:^{
containerView.center = oldCenter;
}];
}completion:^(BOOL finished) {
}];
动画完成后(使用 finished = YES
调用的完成 block ),UIViewController
没有响应,例如我无法按 UIViewController
上的任何 UIButton
。
为什么?
最佳答案
我在完成 block 中添加了这一行:
[transitionContext completeTransition:NO];
这解决了我的问题。
关于ios - animateKeyframesWithDuration 使屏幕在动画后没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23803398/