运维开发网

objective-C语言 从模态视图启动摄像头会导致iPad上出现意外调整大小

运维开发网 https://www.qedev.com 2020-03-19 14:56 出处:网络 作者:运维开发网整理
在我的iPad应用程序中,我创建并调整模式视图,如下所示: ModalViewController *modalController = [[WishlistInfoViewController alloc] initWithNibName:@"WishlistInfoViewController" bundle:nil]; UINavigationController *navControll
在我的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];之后立即重置视图的大小.我不知道为什么我直到现在才尝试这个.
0

精彩评论

暂无评论...
验证码 换一张
取 消