在解雇iOS 8中的模态视图控制器时,UI会失真

时间:2014-10-31 13:17:07

标签: ios objective-c ios8 modalviewcontroller presentviewcontroller

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中将其关闭时,视图会变得扭曲,如第一次屏幕截图所示

感谢任何帮助。 谢谢。distorted view normal view

1 个答案:

答案 0 :(得分:0)

在iOS 8中尝试使用其他演示风格:

self.modalPresentationStyle = UIModalPresentationOverCurrentContext;