给定以下代码
self.view.backgroundColor = [UIColor yellowColor];
MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil]
myVC.view.backgroundColor = [UIColor clearColor];
myVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:myVC animated:NO completion:nil];
当我们调用presentViewController时,实际上发生了什么事情?当myVC可见时,我看不到黄色,然后我在它的viewDidAppear方法中检查了myVC.view.superView,并且它是UIWindow。
Q1.这是否意味着,直到模态窗口弹出presentingViewController.view(在上述情况下为self.view)从视图层次结构中删除,并添加presentedViewController.view(在上述情况下为myVC.view)覆盖UIWindow?
Q2.如果myVC.modalPresentationStyle!= UIModalPresentationFullScreen会怎样?
Q3.iOS是否也会删除除了presentedViewController.view之外的所有视图,直到全屏模态对话框弹出以进行优化?如果不是,为什么不是?
clippingVC
是什么? - rptwsthi