CABasicAnimation
CABasicAnimation Class Reference
Overview
CABasicAnimation provides basic, single-keyframe animation capabilities for a layer property. You create an instance of CABasicAnimation using the inherited animationWithKeyPath: method, specifying the key path of the property to be animated in the render tree.
Setting Interpolation Values
The fromValue, byValue and toValue properties define the values being interpolated between. All are optional, and no more than two should be non-nil. The object type should match the type of the property being animated.
The interpolation values are used as follows:
-
Both
fromValueandtoValueare non-nil. Interpolates betweenfromValueandtoValue. -
fromValueandbyValueare non-nil. Interpolates betweenfromValueand (fromValue+byValue). -
byValueandtoValueare non-nil. Interpolates between (toValue-byValue) andtoValue. -
fromValueis non-nil. Interpolates betweenfromValueand the current presentation value of the property. -
toValueis non-nil. Interpolates between the current value ofkeyPathin the target layer’s presentation layer andtoValue. -
byValueis non-nil. Interpolates between the current value ofkeyPathin the target layer’s presentation layer and that value plusbyValue. -
All properties are
nil. Interpolates between the previous value ofkeyPathin the target layer’s presentation layer and the current value ofkeyPathin the target layer’s presentation layer.
Properties
byValue
Defines the value the receiver uses to perform relative interpolation.
Discussion
See “Setting Interpolation Values” for details on how byValue interacts with the other interpolation values.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.hfromValue
Defines the value the receiver uses to start interpolation.
Discussion
See “Setting Interpolation Values” for details on how fromValue interacts with the other interpolation values.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.htoValue
Defines the value the receiver uses to end interpolation.
Discussion
See “Setting Interpolation Values” for details on how toValue interacts with the other interpolation values.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h

浙公网安备 33010602011771号