UINavigationController和UITabBarController的故事板问题

时间:2012-12-18 10:07:43

标签: iphone objective-c uinavigationcontroller uitabbarcontroller storyboard

我总是使用Storyboard创建我的应用。但此刻他给了我一些困难 你可以在这里看到我的故事板的截图。

问题出在右上角。在我的viewcontroller中有一个UItableview。当我推开一个牢房。我对下一个视图进行了推送。但是当我这个时,我底部的标签栏消失了。

同样在我的UItableview视图中,我在navigationbar内定义了一个左右栏按钮。当我把这两个按钮消失时,我也会得到一个后退按钮(我希望这两个按钮从前一个viewController返回并摆脱后退按钮。)

我如何解决这个问题?

我试过这个:

 self.tabBarController.navigationItem.hidesBackButton = YES;
    self.tabBarController.tabBar.hidden = NO;

提前致谢!

亲切的问候

enter image description here

1 个答案:

答案 0 :(得分:1)

我总是为NavigationController的每个分支使用单独的TabBarController。这可能会导致您的问题。尝试在导航到ViewController的4个TabBarController中的每一个中嵌入导航控制器。

另外,请务必致电:

self.tabBarController.navigationItem.hidesBackButton = YES;

viewDidLoadViewController之后您想要此行为。然后在你调用它之后,你需要实例化你想要使用的两个按钮。

编辑 - 查看this answer以获取使用Protocol和委派登录用户的示例。