在iOS中,UIView Animations和Core Animations有什么区别?
In iOS, what's the difference between UIView Animations and Core Animations?
例如我认为CGAffineTransform 是核心动画。我知道如何在核心动画中旋转对象、缩放和移动对象,但有没有办法在 UIView 动画中执行此操作?
Apple 在其文档中描述:
"In iOS, animations are used extensively to reposition views, change
their size, remove them from view hierarchies, and hide them."
View Programming Guide - Apple
文章继续强调使用 Core Animations 而不是 UIView Animations 来获得更详细的动画。
"In places where you want to perform more sophisticated animations, or
animations not supported by the UIView class, you can use Core
Animation and the view’s underlying layer to create the animation.
Because view and layer objects are intricately linked together,
changes to a view’s layer affect the view itself."
Same Doc - View Programming Guide - Apple
基本上,您可以操纵视图的图层来更改视图。当为此目的存在核心动画时,我认为直接操纵视图是不明智的。所以我自己的回答是否定的,你不能(而且可能不应该)用 UIAnimations 对 UIView 做你可以用 Core Animations 对 Layer 做的事情。
更多信息:
Core Animation Programming Guide 由 Apple
我希望这有助于回答您的问题,并且所提供的资源将有助于进一步深入了解您的问题。
例如我认为CGAffineTransform 是核心动画。我知道如何在核心动画中旋转对象、缩放和移动对象,但有没有办法在 UIView 动画中执行此操作?
Apple 在其文档中描述:
"In iOS, animations are used extensively to reposition views, change their size, remove them from view hierarchies, and hide them."
View Programming Guide - Apple
文章继续强调使用 Core Animations 而不是 UIView Animations 来获得更详细的动画。
"In places where you want to perform more sophisticated animations, or animations not supported by the UIView class, you can use Core Animation and the view’s underlying layer to create the animation. Because view and layer objects are intricately linked together, changes to a view’s layer affect the view itself."
Same Doc - View Programming Guide - Apple
基本上,您可以操纵视图的图层来更改视图。当为此目的存在核心动画时,我认为直接操纵视图是不明智的。所以我自己的回答是否定的,你不能(而且可能不应该)用 UIAnimations 对 UIView 做你可以用 Core Animations 对 Layer 做的事情。
更多信息: Core Animation Programming Guide 由 Apple
我希望这有助于回答您的问题,并且所提供的资源将有助于进一步深入了解您的问题。