UIView.AddKeyframeWithRelativeStartTime(Double, Double, Action) メソッド

定義

アニメーションに 1 つのキーフレームを追加します。

[Foundation.Export("addKeyframeWithRelativeStartTime:relativeDuration:animations:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static void AddKeyframeWithRelativeStartTime (double frameStartTime, double frameDuration, Action animations);
static member AddKeyframeWithRelativeStartTime : double * double * Action -> unit

パラメーター

frameStartTime
Double

含まれているアクションを基準としたアニメーションの開始時刻 (0 から 1)

frameDuration
Double

含まれているアクション (0 から 1) を基準としたアニメーションの継続時間。

animations
Action

キーフレームの終了状態を定義するアクション。

属性

注釈

このメソッドは、 のAnimateKeyframes(Double, Double, UIViewKeyframeAnimationOptions, Action, UICompletionHandler)呼び出しのanimationsアクション内で呼び出されると、アニメーション シーケンス内のキーフレームを指定します。 パラメーターと frameDuration パラメーターの両方が frameStartTime m 0 から 1 の範囲で、外側のパラメーターに対する相対的な期間をAnimateKeyframes(Double, Double, UIViewKeyframeAnimationOptions, Action, UICompletionHandler)duration指定します。

たとえば、次の例では (渡された パラメーターと C# ラムダ式の両方の使用を示しています)、3 番目のframeStartTimeキーフレームと frameDuration はどちらも 0.5 に設定されています。含まれる AnimateKeyframesAsync(Double, Double, UIViewKeyframeAnimationOptions, Action)durationは 3 秒に設定されているため、このアニメーションは 1.5 秒から開始され、完了するまでに 1.5 秒かかります。

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

適用対象