iphone:如何停止快门动画? [英] iphone : how to stop shutter animation?
问题描述
我有2个问题。
1)我想知道如何在装入相机时停止快门动画?我正在使用UIImagePickerController。我已经从堆栈溢出中提到了许多答案,但没有成功。
1) I want to know how can I stop animation of shutter when camera is loaded ? I am using UIImagePickerController. I have referred many answer from stack overflow but did not get succeed.
2)我在相机中使用 cameraOverlayView
进行自定义按钮,并希望在点击时打开照片库。我的代码如下:
2) I have a custom button in camera using cameraOverlayView
and want to open the photo library on click. I have code like :
- (void) showLibrabryPicker
{
pickerLibrary = [[UIImagePickerController alloc] init];
pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerLibrary.delegate = self;
[self presentModalViewController:pickerLibrary animated:YES];
[pickerLibrary release];
}
在相机显示时调用它。
Thnaks ...
Thnaks...
推荐答案
使用 UIImagePickerController
,关于初始快门动画你无能为力。它实际上是隐藏启动时间。您可以切换到使用AVFoundation并获得 AVCaptureVideoPreviewLayer
,它没有快门动画,但是在要求开始和开始之间仍然会有延迟。我不是硬件专家,但我认为延迟是因为电源管理单元通常将整个子系统断电。
Using a UIImagePickerController
, there's nothing you can do about that initial shutter animation. It's actually there to hide the startup time. You can switch to using the AVFoundation and getting an AVCaptureVideoPreviewLayer
, which has no shutter animation, but you still get a latency between asking for the feed to start and it starting. I'm no hardware expert but I assume the delay is because the power management unit normally has that whole subsystem powered down.
showLibraryPicker的代码
看起来或多或少是正确的,尽管你可能在错误的演员身上调用 presentModalViewController:animated:
。 UIImagePickerController
是一个视图控制器,所以如果你还没有子类化(也就是说,你写的代码本身并不是你扮演<$的东西的一部分) c $ c> UIImagePickerController )然后你要做 [pickerController presentModalViewController:...]
。
Your code for showLibraryPicker
looks more or less correct, though you may be calling presentModalViewController:animated:
on the wrong actor. UIImagePickerController
is a view controller, so if you haven't subclassed that (ie, the code you're writing is not itself part of the thing you have acting as a UIImagePickerController
) then you'll want to do [pickerController presentModalViewController:...]
.
这篇关于iphone:如何停止快门动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!