隐藏/显示iPhone相机光圈/快门动画

Ank*_*kur 10 iphone camera objective-c uiimagepickercontroller iphone-sdk-3.0

我无法隐藏我的应用程序的iphone相机快门打开动画.我正在使用UIImagePickerController访问iphone相机并使用我自己的覆盖控制器.有没有办法在相机启动时删除初始快门(也称为光圈)动画.谢谢

[编辑]

对于那些想知道改变相机虹膜动画的方法.

在相机光圈动画开始之前调用以下功能.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    // Here is were I make the camera preview fit the entire screen. 
    // This might violate the "don't change the view hierarchy"-rule. 
    // So I am not sure if it is valid for App Store commitment.
    // However, the NSLogs are used to
    // figure out which subview is the actual Camera Preview which turns out 
    // to be the PLPreviewView. (uncomment to se the printouts).
    // Change it's size to fit the entire screen (and scale it accordingly
    // to avoid distorted image

    NSLog(@"WillShowViewController called...");

    NSLog(@"VC:view:subviews\n %@\n\n", [[viewController view] subviews]);

    NSLog(@"VC:view:PLCameraView:subviews\n %@\n\n", [[[[viewController view] subviews] objectAtIndex: 0] subviews]);

    NSLog(@"VC:view:PLCameraView:PLPreviewView:subviews\n %@\n\n", [[[[[[viewController view] subviews] objectAtIndex: 0] subviews] objectAtIndex: 0] subviews]);
    NSLog(@"VC:view:PLCameraView:PLCropOverLay:subviews\n %@\n\n", [[[[[[viewController view] subviews] objectAtIndex: 0] subviews] objectAtIndex: 1] subviews]);
    NSLog(@"VC:view:PLCameraView:UIImageView:subviews\n %@\n\n", [[[[[[viewController view] subviews] objectAtIndex: 0] subviews] objectAtIndex: 2] subviews]);

}
Run Code Online (Sandbox Code Playgroud)

在上面的函数中,您可以使用普通的NSMuatableArray语法(如objectAtIndex)遍历每个图层

希望这对你有帮助.

问候,

ANKUR

jos*_*hwa 5

这个答案为出发点,我终于解决了这个问题:

注意:这显然不符合3.3.1.

  1. 聆听UINavigationControllerDidShowViewControllerNotification你的UIImagePickerController,PLCameraViewIrisAnimationDidEndNotification全球的.

  2. 遍历视图层次结构(从主要开始UIWindow)查找PLCameraView.将视图的索引保存在main中UIWindow,稍后您将需要它.

  3. PLCameraView从中删除superView.如果需要,请在全局索引0处插入您自己的视图.

  4. 完成虹膜动画后,删除视图并重新添加PLCameraView原始索引.


Bra*_*Guy 0

我对此进行了一些混乱,但将视图生命周期方法的各种组合发送到图像选择器。(viewWillAppear、viewDidAppear 等)但我不记得哪些最终起作用了。