ios JASidePanels 使 UINavigationController 成为 centerViewController [英] ios JASidePanels make the UINavigationController the centerViewController

查看:24
本文介绍了ios JASidePanels 使 UINavigationController 成为 centerViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用的是 JASidePanels 库,一切都使用故事板进行设置和工作,但我想通过单击 tableViewCell 从我的中心视图推送到详细视图,为此我假设我需要一个UINAvigationController,我可以以某种方式让 centerViewController 从 UINavigationController 开始吗?

In my application I am using the JASidePanels libraries, everything is set and working using storyboards, but I would like to push from my center view to a detail view by clicking on a tableViewCell, and for that I am assuming I need a UINAvigationController, can I somehow make the centerViewController start from a UINavigationController?

推荐答案

您必须将故事板标识符放置到导航控制器中,该标识符嵌入了您希望作为中心面板的主视图控制器;然后,在您的基本"视图控制器(您使用 JASidePanelController 子类化的那个)中设置要使用它初始化的中心面板.

You have to put an storyboard identifier to the Navigation Controller that embeds the main view controller you want to have as the center panel; then, set the center panel to be initialized with it in your "base" view controller (the one you subclassed with JASidePanelController).

// Hamburger menu setup
-(void) awakeFromNib
{
    [self setLeftPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"menuViewController"]];
    [self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"mainDashboardNavigationController"]];
}

其中mainDashboardNavigationController"是设置为 UINavigationController 的故事板标识符,该标识符嵌入了您想要作为中心面板呈现的内容.

Where "mainDashboardNavigationController" is the storyboard identifier set to the UINavigationController that embeds what you want to present as center panel.

希望对您有所帮助,详情请参见下方链接中的屏幕截图.Xcode 截图

Hope it helps you, see the screenshot in the link below for more details. Xcode Screenshot

这篇关于ios JASidePanels 使 UINavigationController 成为 centerViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆