gpt4 book ai didi

ios - UITabBarController 的 subview Controller 中的导航栏按钮无响应

转载 作者:行者123 更新时间:2023-11-29 03:07:24 24 4
gpt4 key购买 nike

我通过调用 navigationController.viewControllers = @[[self.storyboard instantiateViewControllerWithIdentifier:@"tabController"]];

来实例化我的 UITabBarController

我的标签栏 Controller 有一个嵌入在导航 Controller 中的 subview 。但是,当我触摸它们(导航栏中的按钮)时,栏按钮 (item) 没有响应。我已尝试记录操作,但按钮似乎根本没有触发。

唯一不同的是我实例化选项卡栏 Controller 的方式。我错过了什么吗?

我将 Storyboard 中的导航栏按钮连接到一个 Action ,因此它已成功连接。请注意,还有一个指向 UITabbarController 的导航 Controller ,未在下面显示。

enter image description here

enter image description here

最佳答案

出现这种不良行为可能是因为 Apple HIG 中不建议这种流程(从导航 Controller 到选项卡栏 Controller )。更多信息可以在这里找到:Storyboard with NavigationController and TabController .我找到的解决方案是隐藏链接到导航栏的导航 Controller 上的导航栏(可以在界面生成器中完成),然后使其重新出现在选项卡栏链接到的新导航 Controller 中。我知道这很令人困惑,我可以帮助任何遇到类似问题的人。

关于ios - UITabBarController 的 subview Controller 中的导航栏按钮无响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22613407/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com