首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有动画的CAAnimation?

没有动画的CAAnimation?
EN

Stack Overflow用户
提问于 2011-09-30 00:45:35
回答 1查看 262关注 0票数 0

我正在尝试使用CAAnimation在我的应用程序中切换视图控制器。当我在这两个特定的视图控制器之间切换时,我不想要任何动画。这个是可能的吗?如果是这样,我将如何实现这一点?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-30 04:58:27

将持续时间设置为0如何:

代码语言:javascript
复制
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;
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7600605

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档