开发者

Changing UINavigationController from UItabBarController

开发者 https://www.devze.com 2023-01-10 19:28 出处:网络
I have a tabBarController with 4 tabs. In the fist one I need to show an UINavigationController which has a UIView in it. When the user presses a button inside that view I need to display another UINa

I have a tabBarController with 4 tabs. In the fist one I need to show an UINavigationController which has a UIView in it. When the user presses a button inside that view I need to display another UINavigationController in tab 1 replacing the old one. Is this possible? I tried using this code with no luck

UINavigationController *t开发者_开发百科ableNavController = [[UINavigationController alloc] initWithNibName:@"Nav2" bundle:nil];

[[self.tabBarController selectedViewController] setView:tableNavController.view];

This replaces the view but not the controller. Please help. Thanks in advance.


Why not just push a fresh viewController onto tab 1's navigationController?

0

精彩评论

暂无评论...
验证码 换一张
取 消