我无法在我的应用程序中隐藏iPhone相机快门开启动画。
我正在使用UIImagePickerController来访问iPhone相机,并使用自己的覆盖控制器。
有没有办法删除相机启动时的初始快门(也称为Iris)动画?
谢谢。
[编辑]
对于那些想知道如何更改相机虹膜动画的人,可以在相机虹膜动画开始之前调用以下函数。
- (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]);
}
在上述函数中,您可以使用普通的NSMutableArray语法(如objectAtIndex)遍历每个层级。
希望这可以帮助您。
问候,
Ankur