在我的iPad应用程序中,我创建并调整模态视图的大小,如下所示:

ModalViewController *modalController = [[WishlistInfoViewController alloc] initWithNibName:@"WishlistInfoViewController" bundle:nil];

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:modalController];
navController.modalPresentationStyle = UIModalPresentationPageSheet;

self presentViewController:navController animated:YES completion:nil];

navController.view.superview.bounds = CGRectMake(0, 0, 700, 700);
navController.view.superview.center = CGPointMake(self.view.center.x, self.view.center.y + 35);

在该模式视图中,我像这样启动相机:
UIImagePickerController *mypicker = [[UIImagePickerController alloc] init];
mypicker.delegate = self;
mypicker.allowsEditing = NO;
mypicker.sourceType = UIImagePickerControllerSourceTypeCamera;
mypicker.showsCameraControls = YES;
mypicker.wantsFullScreenLayout = YES;
[self.navigationController presentModalViewController:mypicker animated:YES];

我像这样解开相机:
[self dismissModalViewControllerAnimated:TRUE];

问题是,当我关闭摄像机时,将调整模式视图的大小以填充整个屏幕。如何防止模态视图调整大小?

最佳答案

好的,所以我解决了我的问题,但是只是在调用[self dismissModalViewControllerAnimated:YES];之后立即重置了视图的大小。我不知道为什么我直到现在才尝试。

08-18 18:50