gpt4 book ai didi

ios - CAAnimation没有动画?

转载 作者:行者123 更新时间:2023-11-29 04:57:53 27 4
gpt4 key购买 nike

我正在尝试使用 CAAnimation 在我的应用程序中切换 View Controller 。当我在这两个特定的 View Controller 之间切换时,我不需要任何动画。这可能吗?如果是这样,我将如何实现这一目标?

谢谢!

最佳答案

将持续时间设置为 0 怎么样:

BOOL shouldAnimate = // here you set your condition whether to animate or not
CFTimeInterval standartDuration = 1.0;

CAAnimation *animation = [CAAnimation animation];
animation.duration = shouldAnimate ? standartDuration : 0.0;

关于ios - CAAnimation没有动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7600605/

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