gpt4 book ai didi

ios - 在 iOS 上,如何延迟 cameraIris 动画的打开部分

转载 作者:行者123 更新时间:2023-11-29 13:34:08 25 4
gpt4 key购买 nike

我正在手动显示虹膜动画:

- (void)playPictureTakenAnimation {
CATransition *animation = [CATransition animation];
animation.type = @"cameraIris";
animation.duration = 0.8f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
irisAinmationView.opaque = 1.0f;
[irisAinmationView.layer addAnimation:animation forKey:@"transitionViewAnimation"];
}

我需要暂停动画直到照片被拍摄和处理,例如:

  1. 快门关闭(动画的前半部分)
  2. 拍摄并处理照片(动画暂停),然后
  3. 重新打开快门(动画的后半部分)

最佳答案

要控制起点和终点,请使用:

animation.startProgress = 0.0; // start
animation.endProgress = 0.5; // halfway

和:

animation.startProgress = 0.5; // halfway
animation.endProgress = 1.0; // end

连同:

- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag

在动画停止时获得控制。

关于ios - 在 iOS 上,如何延迟 cameraIris 动画的打开部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11090838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com