Share via


UIView.AddKeyframeWithRelativeStartTime(Double, Double, Action) 메서드

정의

애니메이션에 단일 키 프레임을 추가합니다.

[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

키 프레임의 끝 상태를 정의하는 작업입니다.

특성

설명

이 메서드는 에 대한 호출 작업 내에서 animations 호출되는 경우 AnimateKeyframes(Double, Double, UIViewKeyframeAnimationOptions, Action, UICompletionHandler)애니메이션 시퀀스에서 키 프레임을 지정합니다. frameStartTimeframeDuration 매개 변수는 모두 0에서 1까지의 범위이며 바깥쪽 매개 변수를 기준으로 기간을 지정합니다AnimateKeyframes(Double, Double, UIViewKeyframeAnimationOptions, Action, UICompletionHandler)duration.

예를 들어 다음 예제(전달된 매개 변수와 C# 람다 식의 사용을 보여 주는)에서 세 번째 키프레임 frameStartTimeframeDuration 은 모두 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);
		}
	);

적용 대상