本文介绍了快门动画AVFoundation iphone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图复制iPhone相机应用程式预设快门动画。
I am trying to replicate iPhone Camera app default shutter animation.
也许有人试过这样做,并有一些提示要分享?
Maybe anyone has tried doing that and have some hints to share?
推荐答案
好吧,我发现这个地方:
Well, I found this somewhere:
CATransition *shutterAnimation = [CATransition animation];
[shutterAnimation setDelegate:self];
[shutterAnimation setDuration:0.6];
shutterAnimation.timingFunction = UIViewAnimationCurveEaseInOut;
[shutterAnimation setType:@"cameraIris"];
[shutterAnimation setValue:@"cameraIris" forKey:@"cameraIris"];
CALayer *cameraShutter = [[CALayer alloc]init];
[cameraShutter setBounds:CGRectMake(0.0, 0.0, 320.0, 425.0)];
[self.layer addSublayer:cameraShutter];
[self.layer addAnimation:shutterAnimation forKey:@"cameraIris"];
这是默认的iPhone相机快门动画。
It's the default iPhone camera shutter animation.
这篇关于快门动画AVFoundation iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!