情况是这样的: 我一直认为在这种方式提出的viewController:UIModalViewController和旋转的UIImagePickerController问题
AddAttachmentPhotoVideoViewController * addAttachment = [[AddAttachmentPhotoVideoViewController alloc]initWithNibName:nil bundle:nil attachmentType:AtImage];
addAttachment.modalPresentationStyle = UIModalPresentationFormSheet;
addAttachment.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:addAttachment animated:YES];
在addAttachment
存在,以这种方式打开相机按钮:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
imagePicker.allowsEditing = NO;
imagePicker.showsCameraControls = YES;
imagePicker.modalPresentationStyle = UIModalPresentationFullScreen;
imagePicker.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:imagePicker animated:YES];
问题如下:当我旋转设备(iPad)时,imagePicker
会自行旋转,但addAttachment
不会旋转;所以当我解雇选择器addAttachment
有一个错误的框架,它不能正常旋转。
换言之,示出了摄像机的情况下,其下的模态视图控制器,不接收旋转等等,当我关闭该选择器,视图控制器的帧是完全错误的。
谢谢...
嗨MaTTP,你能提供一些代码片段来说明解决方案吗?谢谢! – 2013-12-11 03:02:32