gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 04:43:59 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com