4

在我的 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]; 

问题是当我关闭相机时,模态视图会调整大小以填满整个屏幕。我能做些什么来防止模态视图调整大小?

4

1 回答 1

1

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

于 2012-06-02T00:29:09.277 回答