标签栏 (c) 中的导航(控制器) 导航 (c) 中的导航(控制器)
我想在导航控制器内有一个 TabBar 控制器。这样,当在第一个导航控制器上选择一个项目时,它将 TabBar 推入视图。第一个选项卡上的此选项卡栏内是另一个导航控制器。
不过我只想要一个导航栏。
我想出了两种方法,但不确定哪种方法更好(即更容易接受等)?
1)第一个导航控制器实际上不是导航控制器,但对于用户来说它看起来像一个。因此,当在其表视图上选择一个单元格时,第一个 navC 的视图将从超级视图中删除,并添加 TabBarC 的视图,必须手动完成动画。
2)第一个 NavC 实际上是一个 NavC,当选择一个项目并将 TabBar 推到屏幕上时,第一个 NavC 的导航栏被隐藏,以便第一个选项卡的导航栏是屏幕上唯一的导航栏。
I want to have a TabBar controller inside a navigation controller. So that when an item is selected on the first Navigation Controller it pushes the TabBar into view. Inside this tabbar on the first tab is another navigation controller.
However I only want one navigation bar.
I've come up with 2 ways but not sure which way is better (Ie more acceptable etc)?
1) The first navigation controller isn't actually a navigation controller but to the user it looks like one. So when a cell is selected on it's table view the first navC's view is removed from the superview and the TabBarC's view is added, animation would have to be done manually.
2)The first NavC is actually a NavC and when an item is selected and the TabBar is pushed on to the screen the first NavC's navigationbar is hidden so that the first tab's navigationBar is the only nav bar on screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这不是一个好主意。该框架不支持将选项卡栏控制器作为导航控制器中的根视图控制器。 (这句话中有太多的“控制器”)。
来自文档:
(斜体强调我的)
I don't think this is a good idea. The Framework doesn't support having a tab bar controller as the root view controller in a navigation controller. (Too many 'controllers' in that sentence).
From the docs:
(italic emphasis mine)