modalViewController = [storyboard instantiateViewControllerWithIdentifier:@"transparentFullViewController"];
listViewController.view.frame = CGRectMake(0, 0, 900, 333);
CGPoint center=modalViewController.view.center;
listViewController.view.center=center;
[modalViewController addChildViewController:listViewController];
[modalViewController.view addSubview:listViewController.view];
listViewController.view.center = [UIApplication sharedApplication].keyWindow.rootViewController.view.center;
这就是我展示模态视图控制器的方式
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:modalViewController animated:NO completion:nil];
这就是它被驳回的方式
[modalViewController dismissViewControllerAnimated:NO completion:nil];
当我在 iOS 7 中关闭 modalViewController 时,它工作正常并返回到第二个屏幕截图 但是当我在 iOS 8.0 中关闭它时,视图会变得扭曲,如第一个屏幕截图所示
如有任何帮助,我们将不胜感激。 谢谢。
在 iOS 8 中尝试使用另一种演示风格:
self.modalPresentationStyle = UIModalPresentationOverCurrentContext;
您正在设置需要弹出模式的父级属性,这就是它不起作用的原因,
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
但它应该像这样,如这里设置模态控制器呈现样式等
modalViewController.modalPresentationStyle = UIModalPresentationOverFullScreen;
modalViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;