问题描述
运行几分钟后,我的应用程序中的所有动画都消失了,甚至系统动画如警报动画和UINavigationController动画也消失了。可能是什么问题?
After several minutes running all animations in my application disappeared, even system animations like alert animation and UINavigationController animations. What can be the issue?
P.S。我不在任何地方使用 [UIView setAnimationsEnabled]
。
P.S. I dont use [UIView setAnimationsEnabled]
anywhere.
推荐答案
嗯,答案是 - 系统有时会禁用动画,通常情况下,它会重新启用动画。但在我的情况下,由于某种原因,它无法将它们设置为启用。这只发生在UIViewControllers之间的转换期间。我想出的是,每次转换后重置 [UIView setAnimationsEnabled:YES]
。
Well, the answer is - system sometimes disables animations, and, normally, it enables them back on. But in my case, for some reason, it failed to set them back enabled. And this happens only during transitions between UIViewControllers. What I came up with, is to reset [UIView setAnimationsEnabled:YES]
after every transition.
这篇关于一段时间后,动画在iOS应用程序中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!