我正在与 AVFoundation 一起使用自定义相机创建 iOS 应用程序。我的问题是相机旋转,改变前后相机的预览层,如何像原生相机应用一样制作动画。翻转动画?
谢谢,
我正在与 AVFoundation 一起使用自定义相机创建 iOS 应用程序。我的问题是相机旋转,改变前后相机的预览层,如何像原生相机应用一样制作动画。翻转动画?
谢谢,
尝试这个:
CATransition *animation = [CATransition animation];
animation.duration = .5f;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = @"oglFlip";
if (captureDevice.position == AVCaptureDevicePositionFront) {
animation.subtype = kCATransitionFromRight;
}
else if(captureDevice.position == AVCaptureDevicePositionBack){
animation.subtype = kCATransitionFromLeft;
}
[capturePreviewLayer addAnimation:animation forKey:nil];