看起来我在 PresentView 转换和 UIAnimations 之间有一些有趣的冲突。简而言之,用户应该能够点击 View A 中的按钮图形。然后转到下一个 View ,通过溶解过渡查看 B。到达ViewB时;应该有一个由 UIAnimation 播放的动画。
下面的代码显示了从ViewA到View B的调用代码:
[WizzAnimationManager pulseOnce:buttonToPulse toSize:0.9 withDuration:0.15];
[NSThread sleepForTimeInterval:0.2];
UIStoryboard* mainStoryBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
WizzPlayViewController* vc = [mainStoryBoard instantiateViewControllerWithIdentifier:@"WizzPlayView"];
vc.modalTransitionStyle=UIModalTransitionStyleCrossDissolve;
[self presentViewController:vc animated:YES completion:Nil];
问题是 ViewB 的 UIAnimation 应该从屏幕的一侧转换到另一侧。使用上面的代码,“结束”动画只显示但没有翻译。换句话说,就像没有执行 UIAnimation。
现在,当我将 PresentViewController 标志“Animated”设置为 NO 时; View B UIAnimation 的翻译工作正常;然而,来自 ViewA 的脉冲动画不再有效(当然,只要 crossDissolve 过渡)。
我不太清楚一个 View 到另一个 View 之间的转换与 ViewB 的动画之间的关系;但我能感觉到两者之间存在优先级冲突
有没有人遇到过类似的问题?提前感谢您提供的任何提示。
最佳答案
在 AnotherView 上,您必须在延迟后执行动画代码,然后它才会看起来正常。
[self performSelector:@selector(animationCode:) withObject:nil afterDelay:0.1];
关于ios - PresentView 和 UIAnimation View 冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24845342/