繁体   English   中英

iphone:如何停止快门 animation?

[英]iphone : how to stop shutter animation?

我有2个问题。

1)我想知道如何在相机加载时停止快门的animation? 我正在使用 UIImagePickerController。 我已经从堆栈溢出中引用了许多答案,但没有成功。

2)我在相机中有一个使用cameraOverlayView的自定义按钮,并且想在点击时打开照片库。 我有如下代码:

- (void) showLibrabryPicker
{
    pickerLibrary = [[UIImagePickerController alloc] init];
    pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    pickerLibrary.delegate = self;
    [self presentModalViewController:pickerLibrary animated:YES];
    [pickerLibrary release];
}

当相机已经显示时它会被调用。

谢谢...

使用UIImagePickerController ,您对初始快门 animation 无能为力。 它实际上是为了隐藏启动时间。 您可以切换到使用 AVFoundation 并获得一个没有快门 animation 的AVCaptureVideoPreviewLayer ,但是在请求开始和开始之间仍然存在延迟。 我不是硬件专家,但我认为延迟是因为电源管理单元通常会关闭整个子系统。

您的showLibraryPicker代码看起来或多或少是正确的,尽管您可能在错误的演员上调用了presentModalViewController:animated: :。 UIImagePickerController是一个视图 controller,所以如果你没有对它进行子类化(即,你正在编写的代码本身并不是你作为UIImagePickerController的一部分)那么你会想要做[pickerController presentModalViewController:...] .

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM