将导航堆栈移至更多选项卡

发布于 2024-12-26 18:42:48 字数 316 浏览 1 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清旖 2025-01-02 18:42:48

其中一种方法是在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文