ios - 切换跟控制器后。上一个控制器presentViewController子控制器的VIew还在。为什么?
PHPz
PHPz 2017-04-18 09:27:54
0
1
293
        UIViewController *red = [[UIViewController alloc]init];
        red.view.backgroundColor = [UIColor redColor];
        //当前控制器 presentViewController 一个子控制器
        [self presentViewController:red animated:YES completion:nil];
        
        [UIApplication sharedApplication].keyWindow.rootViewController = [[ViewController alloc]init];

        [[UIApplication sharedApplication].keyWindow sendSubviewToBack:[UIApplication sharedApplication].keyWindow.rootViewController.view];
        
        //在 ViewController 加载完毕后。red.view也在window中。为什么没有伴随上一个控制器一起被销毁呢?
PHPz
PHPz

学习是最好的投资!

reply all(1)
刘奇
 [[UIApplication sharedApplication].keyWindow makeKeyAndVisible]
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template