0

我正在寻找在 UITabBar 级别拆分 Storyboard 的解决方案。我有一个带有 5 个选项卡的应用程序,我想用不同的故事板管理每个选项卡。该结构将是一个简单的最小故事板,带有标签栏控制器和 5 个更大的故事板,每个标签视图控制器(和 segues)都必须继承标签栏。每个人都曾这样拆分故事板吗?有什么线索吗?谢谢

4

2 回答 2

3

我认为这是可能的,这应该进入您自定义的“viewDidLoad” UITabBarController......

NSMutableArray *controllersArray = [[NSMutableArray alloc] init];

// Load the initial UIViewController from every Storyboard
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];
UIViewController *first = [sb instantiateViewControllerWithIdentifier:@"firstViewController"];
[controllersArray addObject:first];

// Repeat the process with the rest
...

// Set your controllers
self.viewControllers = [controllersArray copy];

请记住为每个 main 设置 Storyboard ID UIViewController,在示例中为“firstViewController”。

于 2013-02-21T09:05:05.840 回答
1

我们使用来自:http ://robsprogramknowledge.blogspot.co.il/search/label/UIStoryboard 的 RBStoryboardLink 来解决这个问题

于 2013-07-08T06:55:31.590 回答