Single keyframe based animations.
[Foundation.Register("CABasicAnimation", true)] public class CABasicAnimation : CoreAnimation.CAPropertyAnimation
type CABasicAnimation = class inherit CAPropertyAnimation
The animation is created by calling the FromKeyPath(String) method and providing a keyPath that identifies the property on the target that will be animated. The animation is performed by using the values on the From, To and By properties applied to the keyPath.
The interpolation will depend on the values that you choose to set for From, To and By. The following table shows the effects of setting one or more of those properites on the property referenced by the key path:
|No values are set||Interpolates between old value and new value in the presentation layer.|
|From is set||Interpolation is done from the From value to the current value in the presentation layer.|
|To is set||Interpolation is done from the current value in the presentation layer to the To value.|
|By is set||Interpolation is done between the current value on the presentation layer to the current value plus the value in By.|
|From and To are set||Interpolation is done between the From and To values.|
|From and By are set||Interpolation is done between the value set in From to From plus By.|
|To and By are set||Interpolation is done between To minus By and By.|
The From, To and By properties all take NSObject parameters. If you need to specify other parameters, like a CGColor, you can use the methods that take INativeObject parameters (GetByAs, GetFromAs, GetToAs, SetBy, SetFrom, SetTo).
For example, the following will animate the "radius" property for three seconds, from its current value, to the value 120 and will repeat this ten times.
var radiusAnimation = CABasicAnimation.FromKeyPath ("radius"); radiusAnimation.Duration = 3; radiusAnimation.To = NSNumber.FromDouble (120); radiusAnimation.RepeatCount = 10;
The above works to set the “To” property to an NSObject, in this case the number 120. If you want to set this for other kinds of objects, you can use the SetTo method, for example, the following sets the target color to a CGColor:
var radiusAnimation = CABasicAnimation.FromKeyPath (“shadowColor"); radiusAnimation.Duration = 3; radiusAnimation.SetTo (UIColor.Red.CGColor); radiusAnimation.RepeatCount = 10;
Default constructor that initializes a new instance of this class with no parameters.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
|Additive Additive||Inherited from CAPropertyAnimation|
|AnimationEvents AnimationEvents||Inherited from CAAnimation|
When the animation completes, this determines if the animation will automatically reverse .(Inherited from CAAnimation)
The begin time of the animation, in seconds, relative to its parent (if applicable).(Inherited from CAAnimation)
Value to increment by.
|Class Class||Inherited from NSObject|
The handle for this class.
|Cumulative Cumulative||Inherited from CAPropertyAnimation|
A developer-meaningful description of this object.(Inherited from NSObject)
An instance of the CoreAnimation.CAAnimationDelegate model class which acts as the class delegate.(Inherited from CAAnimation)
Description of the object, the Objective-C version of ToString.(Inherited from NSObject)
Duration in seconds for this animation.(Inherited from CAAnimation)
|FadeInDuration FadeInDuration||Inherited from CAAnimation|
|FadeOutDuration FadeOutDuration||Inherited from CAAnimation|
The FillMode for this animation, use the CAFillMode constants as the values for this property.(Inherited from CAAnimation)
Initial value for the property to animate.
Handle (pointer) to the unmanaged object representation.(Inherited from NSObject)
|IsDirectBinding IsDirectBinding||Inherited from NSObject|
|IsProxy IsProxy||Inherited from NSObject|
|KeyPath KeyPath||Inherited from CAPropertyAnimation|
Whether the animation is removed from the layer on completion.(Inherited from CAAnimation)
Number of times to repeat the animation.(Inherited from CAAnimation)
The number of seconds that the animation will repeat for.(Inherited from CAAnimation)
Returns the current Objective-C retain count for the object.(Inherited from NSObject)
|Self Self||Inherited from NSObject|
The speed scale applied to this animation. A value of 2.0 will make animations run twice as fast as the parent animations.(Inherited from CAAnimation)
|Superclass Superclass||Inherited from NSObject|
Handle used to represent the methods in the base class for this NSObject.(Inherited from NSObject)
Extra time offset in the local time.(Inherited from CAAnimation)
The timing function used to compute the animation.(Inherited from CAAnimation)
Destination value for the property to animate.
|UsesSceneTimeBase UsesSceneTimeBase||Inherited from CAAnimation|
|ValueFunction ValueFunction||Inherited from CAPropertyAnimation|
An object that can respond to the delegate protocol for this type(Inherited from CAAnimation)
|Zone Zone||Inherited from NSObject|
Event raised by the object.(Inherited from CAAnimation)
Event raised by the object.(Inherited from CAAnimation)
Gets the array of UIAccessibilityCustomRotor objects appropriate for
|SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor) SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor)||
Sets the array of UIAccessibilityCustomRotor objects appropriate for
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.