0
如何在不使用initWithRootViewController的情況下在UINavigationController之上顯示模態ViewController,只需將它添加到現有的navigationcontroller堆棧中?將ViewController添加到現有的UINavigation堆棧
我的代碼是:
TableViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"TableView"];
UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:controller];
[self presentViewController:navi animated:NO completion:nil];
編輯:我其實想的是做這樣的: 「VC1推VC2模式VC3」 比用 「poptoroot ......到VC1」。但initWithRootViewController(vc3)正在破壞它。
目前的模式和添加到現有的導航控制器是互斥的。也許你正在尋找'[self.navigationController pushViewController:controller animated:YES];'?! –
我不想使用推。代碼完美地工作在is。我真正想要做的就是像「vc1 push vc2 modal vc3」,而不是使用「poptoroot ... to vc1」。但initWithRootViewController(vc3)正在破壞它。 – user3295976
嘗試呈現您的控制器,而不是navi – Johnykutty