ios - animateKeyframesWithDuration 使屏幕在动画后没有响应

标签 ios uiview uiviewanimation

我使用 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/

相关文章:

ios - iOS7 上固定中心的 CALayer 动画比例尺

ios - 当我在子类中初始化我的 UIView 时会发生什么?

iphone - UIBezierPath 不绘制圆底角

iphone - 动画期间的布局 subview ?

ios - UITextField 上的 UITapGestureRecognizer 在 IOS 7.1 中不再有效

ios - Superview 不会根据 subview 约束增加高度

ios - 替换相似单元格时平滑表格动画

ios - 在 iOS 8 中的扩展中进行 inapp 购买

ios - 使用 UIScrollView 中的动态内容调整 UiView 高度(Swift)

iOS 辅助功能 - 控制哪个 UI 对象获得焦点