Removing NavigationController Programmatically

前端 未结 2 1421
梦谈多话
梦谈多话 2021-01-07 01:14

the application contains more than one navigation controller. (example below)

NavigationController1 ----> ViewController1 ---> TabBarController -->          


        
相关标签:
2条回答
  • 2021-01-07 01:17

    The black screen is nothing but UIWindow. When you are removing NavigationController , the windows doesn't have any NavigationController. So you will have to set NavigationController for window as soon as you remove your first NavigationController.

    You can try like this:

     let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
    
     appDelegate.window?.rootViewController = YOUR_NAVIGATION_CONTROLLER_OBJECT;
    
    0 讨论(0)
  • 2021-01-07 01:37

    May be this can help:

    [self.window addSubview:secondNavigationController.view];
    

    Add the view of second navigation controller in the window.

    0 讨论(0)
提交回复
热议问题