Objective c UIModalPresentationFormSheet上的UIImagePickerController:ipad

Objective c UIModalPresentationFormSheet上的UIImagePickerController:ipad,objective-c,ipad,uimodalpresentationstyle,Objective C,Ipad,Uimodalpresentationstyle,我正在使用UIModalPresentationFormSheet并打开UIImagePickerController(或任何UIViewController),但在关闭UIImagePickerController或任何其他控制器时,UIModalPresentationFormSheet的大小会发生变化 modalViewController *changeProfilePicture = [[ModalViewController alloc] init]; UINavigationCon

我正在使用UIModalPresentationFormSheet并打开UIImagePickerController(或任何UIViewController),但在关闭UIImagePickerController或任何其他控制器时,UIModalPresentationFormSheet的大小会发生变化

modalViewController *changeProfilePicture = [[ModalViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[mainViewController presentModalViewController:navigationController animated:YES];
navigationController.view.superview.frame = CGRectMake((CGRectGetWidth(mainViewController.view.bounds)-300)/2, (CGRectGetHeight(mainViewController.view.bounds)-300)/2, 300, 300);
在modalViewController中,我打开UIImagePickerController以全屏模式拾取图像。然后modalViewController的帧大小几乎是原来的两倍

在popoverview中打开UIImagePickerController时,一切正常

但这里我的要求是,我还必须在全屏模式下打开其他一些viewController


知道我们如何保持modalViewController的帧大小吗。

我建议使用self.frame获取父视图的帧大小,并将其传输到您遇到问题的UIImagePicker。那应该可以缩小尺寸。

谢谢泰勒,你想说什么。我应该缩小UIImagePicker的尺寸还是其他什么。是的,我认为你应该改变UIImagePicker的尺寸……毕竟,是什么让你的modalView框架“膨胀”了,不是吗?另一方面,您可能希望将当前Rect保存到一个变量中,这样您就可以将大小“重置”为添加UIImagePicker后的大小。继续,尝试一下,然后告诉我如何…或者它是否有效:)