UIKit.UIView.AddKeyframeWithRelativeStartTime Method
Adds a single keyframe to an animation.

Syntax

[Foundation.Export("addKeyframeWithRelativeStartTime:relativeDuration:animations:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_7_0)]
public static void AddKeyframeWithRelativeStartTime (double frameStartTime, double frameDuration, [ObjCRuntime.BlockProxy(typeof(ObjCRuntime.Trampolines/NIDAction))] Action animations)

Parameters

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.

Remarks

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);
		}
	);
    

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0