iphone – 动画完成立即调用

iphone – 动画完成立即调用,第1张

概述我有以下动画块: [UIView animateWithDuration:2 animations:^{ [childViewController_.view setAlpha:0]; } completion:^(BOOL finished) 我有以下动画块:

[UIVIEw animateWithDuration:2                  animations:^{                      [childVIEwController_.vIEw setAlpha:0];                   }                  completion:^(BOol finished) {                     [childVIEwController_.vIEw removeFromSupervIEw];                 }];

当如上执行时,立即调用完成块.
但是,如果我没有完成块,则按预期执行动画.

我在这做错了什么?

更新
完成块中的完成标志为NO.

解决方法 你忘了检查一个条件

[UIVIEw animateWithDuration:2                  animations:^{                      [childVIEwController_.vIEw setAlpha:0];                   }                  completion:^(BOol finished) {                     if (finished)                     {                          [childVIEwController_.vIEw removeFromSupervIEw];                     }                 }];
总结

以上是内存溢出为你收集整理的iphone – 动画完成立即调用全部内容,希望文章能够帮你解决iphone – 动画完成立即调用所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1084332.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存