【问题标题】:Loading view from another storyboard into view of another storyboard将另一个故事板的视图加载到另一个故事板的视图中
【发布时间】:2013-02-03 18:30:16
【问题描述】:

我有这样的要求。

该应用的实现类似于我们在 facebook 或 path 应用中找到的滑动面板 UI。 我正在使用 JSSlidePanel (https://github.com/gotosleep/JASidePanels),它需要添加 3 个控制器,

slidePanellcontroller.leftPanel = leftsideViewController;
slidePanellcontroller.centerPanel = centerViewController;
slidePanellcontroller.rightPanel = rightsideViewController;

我为 slidePanelcontroller 和 centerViewController 创建了单独的故事板。 slidePanelcontroller 是从主故事板加载的,而 centerViewController 将从另一个名为 tabbar 故事板的故事板中加载。基本上 centerViewController 是一个标签栏控制器。

现在我不确定如何将 centerViewController 的视图添加到 slidePanelcontroller 视图中。

请提供任何意见。

谢谢,

【问题讨论】:

  • 这有什么更新吗?非常感谢。

标签: ios5 storyboard


【解决方案1】:

Firsts 实例化另一个故事板:

UIStoryboard otherStoryboard = [UIStoryboard storyboardWithName:@"otherstoryboardfilename" bundle:nil];

然后通过您在 Interface Builder 中为其设置的标识符实例化视图控制器。

UIViewController *centerViewController =
  [otherStoryboard instantiateViewControllerWithIdentifier:@"centerViewControllerIdentifier"]

【讨论】:

    猜你喜欢
    • 2011-12-01
    • 2019-12-17
    • 2013-09-17
    • 2014-11-13
    • 2013-06-16
    • 2017-12-15
    • 1970-01-01
    • 2017-02-22
    • 2012-03-23
    相关资源
    最近更新 更多