- frameStartTime
- The starting time of the animation, relative to the containing action (0-1)
- frameDuration
- The duration of the animation, relative to the containing action (0-1).
- animations
- The action defining the ending state of the keyframe.
This method, when called within the animations action of a call to UIView.AnimateKeyframes, specifies a keyframe in an animation sequence. Both the frameStartTime and frameDuration parameters range fro m 0 to 1 and specify durations relative to the enclosing UIView.AnimateKeyframesduration parameter.
For instance, in the following example (which shows the use of both passed-in Foundation.NSAction parameters and a C# lambda expression), the third keyframe's frameStartTime and frameDuration are both set to 0.5; since the the containing UIView.AnimateKeyframesAsync's duration is set to 3 seconds, this animation will start at 1.5 seconds and take 1.5 seconds to complete.
C# Example
var animationSucceeded = await UIView.AnimateKeyframesAsync(
duration : 3,
delay : 0,
options: UIViewKeyframeAnimationOptions.AllowUserInteraction,
animations: () => {
UIView.AddKeyframeWithRelativeStartTime(0, 0.25, () => label.Frame = new RectangleF(label.Frame.Left + 250, label.Frame.Top, label.Frame.Width, label.Frame.Height)
);
UIView.AddKeyframeWithRelativeStartTime(0.25, 0.25, keyframe2);
UIView.AddKeyframeWithRelativeStartTime(0.5, 0.5, keyframe3);
}
);