Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您使用 [UIView animate...] 您可以在模拟器中切换慢速动画。但是如果你使用图层和 CAAnimation——那些动画不会变慢。是什么原因?
不幸的是,模拟器只能切换 UIView 动画的速度。
作为一种解决方法,只需设置 UIWindow 或任意根视图的 speed 属性:
view.layer.speed = 0.1f; // 10x slower animations
这会减慢图层子层次结构中的所有 CAAnimations,包括 UIView 动画。
边打字边生活