【问题标题】:TabBarController + NavigationController :Push and Pop issueTabBarController + NavigationController:推送和弹出问题
【发布时间】:2012-08-28 08:46:13
【问题描述】:
我正在使用包含导航控制器的初始根视图控制器:
现在我想从 uiviewcontroller 1.2.1 导航到 uiviewcontroller 1.1
self.pushview 和 self.popView 等所有常规解决方案都不起作用;
他们正在创建包含页面的 UITabBarController 的另一个实例......
请各位大佬联手..
任何帮助将不胜感激.......
【问题讨论】:
标签:
iphone
objective-c
ios
ipad
apple-push-notifications
【解决方案1】:
您不必对导航控制器层次结构感到惊愕
用于将自导航控制器导航到父导航控制器使用
self.tabBarController.navigationController
使用此代码
PUSH : [self.tabBarController.navigationController pushViewController:objNav animated:YES];
POP : [self.tabBarController.navigationController popViewControllerAnimated:YES];
谢谢,
【解决方案2】:
对于 Swift 3.0
推:
self.tabBarController?.navigationController?.pushViewController(ViewControleer, animated: true)
self.tabBarController?.show(ViewControleer, sender: self)
流行:
self.tabBarController?.navigationController?.popToRootViewController(animated: true)
self.tabBarController?.navigationController?.popViewController(animated: true)
self.tabBarController?.navigationController?.popToViewController(ViewControleer, animated: true)