UIImagePickerController相机实时预览错误的横向iPad应用程序方向

时间:2015-06-03 11:39:15

标签: objective-c ipad camera uiimagepickercontroller screen-orientation

我有一个实现UIImagePickerController源类型相机的iPad应用程序。当为设备启用旋转时,如果我在保持纵向模式的情况下从图像选择器中选择相机(应用程序仅支持横向模式),则相机视图将显示90度旋转。如果我们锁定旋转,相机工作正常。用于呈现相机视图的代码是 -

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePickerController.delegate = self;

self.imagePickerController = imagePickerController;
    [self presentViewController:self.imagePickerController
                       animated:YES
                     completion:nil
     ];

有人有任何建议吗?

0 个答案:

没有答案