如何将新的视图控制器推送到不同的导航控制器堆栈并切换到它?
我在 Interface Builder 中创建了一个选项卡栏控制器,
选项卡栏中有 4 个导航控制器。
每个控制器都单独且完美地运行(耶!)
我需要做的是将视图控制器推送到不同的导航控制器堆栈上,并将焦点切换到适当的选项卡栏项目上(以便用户侧向移动(到不同的选项卡)并同时向上(到新视图)。
这是我第一次使用标签栏控制器,虽然到目前为止很简单,但弄清楚这一点让我很舒服。如果您能向我提出任何建议,我将不胜感激。
I have a Tab Bar Controller created in Interface Builder
Within the Tab Bar are 4 Navigation Controllers.
Each controller functions separately and perfectly (yay!)
What I need to be able to do is a push a view controller onto a different nav controllers stack and switch the focus onto the appropriate tab bar item (so that the user moves sideways (to a different tab) and up (to a new view) at the same time).
This is my first time working with a tab bar controller, and while it's been simple to this point, figuring this out is giving me fits. Any tips you can toss my way would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将使用类似以下内容作为起点,其中
whichTab
是您将推送到的选项卡的索引,而newViewController
是您要推送的视图控制器并切换到。您可能需要尝试一下推送与切换的顺序。I would use something like the following as a starting point, where
whichTab
is the index of the tab you will be pushing onto, andnewViewController
is the view controller you want to push and switch to. You may need to play around with the ordering of pushing versus switching.