ViewController *vc = [[ViewController alloc]init];
// UINavigationController *nav = [[UINavigationController alloc] init];
// [nav addChildViewController:vc];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
// UINavigationController *nav = [[UINavigationController alloc]init];
// [nav pushViewController:vc animated:YES];
// UINavigationController *nav = [[UINavigationController alloc]init];
// nav.viewControllers = @[vc];//添加到导航控制器的栈中,
//
self.window.rootViewController = nav;
把子控制器添加到导航控制器中的四种方法
最新推荐文章于 2020-06-05 14:20:19 发布