3

我正在尝试在 iPad 中显示完整的相机。但它显示的相机非常小。我在这个代码下面使用。

imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.delegate=self;
    imagePicker.cameraOverlayView.frame = CGRectMake(0, 0, 1000, 700);
    [imagePicker.cameraOverlayView sizeToFit];
    UIPopoverController  *popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
    imagePicker.wantsFullScreenLayout = YES;
    [imagePicker release];
                [popover presentPopoverFromRect:CGRectMake(0,0,400,800) 
                                 inView:self.view
               permittedArrowDirections:UIPopoverArrowDirectionAny 
                               animated:YES]; 
4

1 回答 1

10

UIImagePickerController是一个UINavigationController。只需将其显示为全屏模式视图控制器,而不是在弹出窗口中。

UIImagePickerController *ipc = [[UIImagePickerController alloc] init];
ipc.delegate = self;
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.modalPresentationStyle = UIModalPresentationFullScreen;

[self presentViewController:ipc animated:YES completion:nil];

您只需要使用 iPad 上的弹出框从照片库中选择图像。但是允许相机在没有弹出窗口的情况下全屏显示。

于 2012-11-06T05:58:36.880 回答