我正在尝试使用 storyboard
在我的项目中实现 JASidePanels
。你可以在这里看到我的 Storyboard。
问题是我没有在导航栏中看到显示左面板的按钮。在我的 RootViewController 中,我在代码中有这个。
-(void) awakeFromNib
{
[self setLeftPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"leftViewController"]];
[self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"centerViewController"]];
[self setRightPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"rightViewController"]];
self.shouldResizeLeftPanel = YES;
self.shouldResizeRightPanel = YES;
[self setRightFixedWidth:300.0f];
[self setLeftFixedWidth:300.0f];
}
我已按照他们在 github page 上所说的步骤进行操作.
此外,当我尝试将 RootviewController
嵌入 navigationController
时。它显示了导航栏,但没有显示 barbutton item
。
有什么帮助吗?
最佳答案
将 Storyboard中的中心 UIViewController 嵌入到 UINavigationController 中,例如:
- 在 Storyboard上选择 UIViewController
- 选择 Xcode 菜单项 Editor - Embed In - Navigation Controller
- 选择新的 UINavigationController 的身份检查器 (Alt-Command-3)
- 为 StoryBoard ID 指定唯一的名称,例如我的中心 Controller
使用该名称创建中心面板
[self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"myCenterController"]];
所以你实际上并没有将 viewController 设置为 centerPanel,而是一个包含你的 viewController 的导航 Controller 。
关于ios - JASidepanels 不显示导航按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15379588/