Ios iPad UIImagePickerControllerSourceTypeCamera强制旋转导致父模式视图原点不正确
我有一个样式UIModalPresentationFormSheet的模态视图,它显示一个UIImagePickerControllerSourceTypeCamera。表单工作表模式视图是从自定义视图控制器容器中显示的 图像选择器强制应用程序更改为纵向。如果在图像选择器关闭之前将应用程序旋转到纵向模式,则一切正常 但是,当设备处于横向时,图像选择器关闭后,表单样式的模态视图现在位于其父帧的左上角(请参见图像) 我猜模态视图的superview没有在背景中旋转。但是,一旦图像选择器被取消,模态视图的帧将被设置为与之前一样Ios iPad UIImagePickerControllerSourceTypeCamera强制旋转导致父模式视图原点不正确,ios,ipad,orientation,uiimagepickercontroller,presentmodalviewcontroller,Ios,Ipad,Orientation,Uiimagepickercontroller,Presentmodalviewcontroller,我有一个样式UIModalPresentationFormSheet的模态视图,它显示一个UIImagePickerControllerSourceTypeCamera。表单工作表模式视图是从自定义视图控制器容器中显示的 图像选择器强制应用程序更改为纵向。如果在图像选择器关闭之前将应用程序旋转到纵向模式,则一切正常 但是,当设备处于横向时,图像选择器关闭后,表单样式的模态视图现在位于其父帧的左上角(请参见图像) 我猜模态视图的superview没有在背景中旋转。但是,一旦图像选择器被取消,模态
Create a custom class of UIImagePickerController. Override supportedInterfaceOrientations meted
- (NSUInteger) supportedInterfaceOrientations
{
//Because your app is only landscape, your view controller for the view in your
// popover needs to support only landscape
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate{
return yes;
}
//call custom view like this
CustomImagePickerViewController *picker = [[CustomImagePickerViewController alloc] init];
picker.supportedInterfaceOrientations= UIInterfaceOrientationMaskAll;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[self presentViewController:picker animated:YES completion:nil];