Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c UIImagepickerController没有在iPhone 4.2的全视图中显示摄像头_Objective C_Uiimagepickercontroller - Fatal编程技术网

Objective c UIImagepickerController没有在iPhone 4.2的全视图中显示摄像头

Objective c UIImagepickerController没有在iPhone 4.2的全视图中显示摄像头,objective-c,uiimagepickercontroller,Objective C,Uiimagepickercontroller,当我使用UIimagepicker控制器调用摄像头时,它在iOS 4.2版的iPhone上不会以全屏模式显示,但在iOS 5中确实可以工作 谁能告诉我需要更改的代码以及现有代码的问题是什么 我正在使用以下代码: - (IBAction)takePicture:(id)sender { UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init]; imagePicker.d

当我使用
UIimagepicker
控制器调用摄像头时,它在iOS 4.2版的iPhone上不会以全屏模式显示,但在iOS 5中确实可以工作

谁能告诉我需要更改的代码以及现有代码的问题是什么

我正在使用以下代码:

    - (IBAction)takePicture:(id)sender 
{

    UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];

    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.showsCameraControls = YES;
    imagePicker.allowsEditing = NO;
    imagePicker.toolbarHidden = YES;
    imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    imagePicker.wantsFullScreenLayout = YES;

    if ([UIImagePickerController respondsToSelector:@selector(isCameraDeviceAvailable:)])
    {
        if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront])
        {
            [imagePicker setCameraDevice:UIImagePickerControllerCameraDeviceFront];


        }
    }

    // Show the camera UI and View Finder.

    [self presentModalViewController:imagePicker animated:YES];
    [imagePicker release];
}
请检查附件

其中一个解决方案是应用缩放变换信息-也许它会有所帮助

我不明白你为什么要做这三件事:

[self.navigationController setNavigationBarHidden:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
[self.camPicker.view setUserInteractionEnabled:YES];
或者出于这个原因,您正在缓存UIImagePickerController的实例(这可能会导致应用程序的空闲内存使用率显著高于在两次使用之间丢弃图像选择器控制器)。 如果你不做这些事情,效果会更好吗