objective-c - UITabBarController 为 TabBar 的每个 ViewController 提供不同的 Storyboard文件

标签 objective-c xcode uitabbarcontroller uistoryboard

我的团队正在开发一个具有 UITabBarController 的应用程序。我们正在使用 Storyboard 来开发界面和流程。

因为我们是一个团队,我们不能把所有的流程都放在一个 Storyboard里,因为它会导致与 SVN 同步的问题。所以,解决方案是to put each tab`s flow in one different storyboard file .

当我可以创建一个对象来进行连接(例如按钮)时, Storyboard之间的连接就不是问题了,正如我们在 this tutorial 中看到的那样.

但是当我将 UITabBarController 放入一个 Storyboard 中时,我无法以编程方式设置将为 tabBar 的每个按钮显示的 Storyboard 来管理底部栏的 View 元素(tabBar 本身)。

现在,我在同一个 .storyboard 文件中有 TabBar 和 UIViewControllers,正如我们所见:

enter image description here

所以我需要的是通过一个UITabBarController连接不同的 Storyboard。如何做到这一点?

最佳答案

您可以使用 Storyboard 引用将应用的各个部分分开并保存在单独的 Storyboard 文件中。使用 UITabBarController 只需按住 ctrl 链接到引用,并确保将 UITabBarItem 添加到新 Storyboard 中的 ViewController。 enter image description here

关于objective-c - UITabBarController 为 TabBar 的每个 ViewController 提供不同的 Storyboard文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17924064/

相关文章:

ios - TabBar 隐藏在 viewDidLoad 中但不隐藏在手势功能中

ios - 如何将自定义 header 添加到 AFNetworking 上传任务?

ios - 如何为 cocos2d 应用设置单元测试?

java - 语言之间的串行通信

ios - 在 xcode 6 swift 中单击按钮时关闭我的 containerview(= 应用程序的弹出窗口)

xcode - Xcode 4 中的代码大小

objective-c - 从 UIImageVIew 获取 UIImage origin.x

android - 合适的旧 keystore 不工作

ios - UITabBar 在单击时摆脱了屏幕顶部的 UINavigation 项目

swift - 从 NSObject 类更新 UITabBarController 栏项目