将导航堆栈移至更多选项卡
我在 UITabBar
的某个选项卡上有一个 UINavigationController
。当我深入到导航控制器 tableViews 中,将其移动到“更多”选项卡中,然后选择“更多”列表中的 tableview 中的条目时,我得到了在我离开移动的选项卡时可见的 viewController。单击后退按钮可以让我返回到更多列表,而无法返回到初始根视图控制器。
当我单击更多列表中的项目时,让根视图控制器出现对我来说是完全可以的,但我不知道如何在移动视图控制器时收到通知,因为我正在开发一个库,所以没有对 TabBarController 的引用。
I have a UINavigationController
on some tab of a UITabBar
. When I drill down into the navigation controllers tableViews, move it into the more-tab, and then select the entry in the tableview in the more-list, i get the viewController that was visible at the time i left the tab i moved. Clicking on the back-button gets me back to the more-list, with no possibility to get back to the initial root view controller.
It would be perfectly okay for me to have the root view controller appear when i click on the item in the more-list, but i have no idea how to get notified when my viewcontroller is moved, since i am developing a library, and so have no reference to the TabBarController.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其中一种方法是在 UITabBarViewController 委托中实现
tabBarController:willEndCustomizingViewControllers:changed:
方法。并留意它。如果发生这种情况,请重置 viewController 和 navigationViewController。这会删除您的 UINavigationController 堆栈,但应用程序将正常工作。One of the ways is to implement
tabBarController:willEndCustomizingViewControllers:changed:
method in UITabBarViewController delegate. And watch for it. If such thing happend then reset you viewController and navigationViewController. This remove your UINavigationController stack, but application will work correctly.