- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用实用程序应用程序的模板。在 FlipSideViewController 中,我为 UINavigationController navController 添加了 IBOutlet。在代码中,我添加了 navController 就很好了。 rootViewController 完美加载:
navController.viewControllers = [[NSArray arrayWithObject:rootViewController] retain];
[self.view addSubview:navController.view];
我很好地改变了 navController 的颜色:
navController.navigationBar.tintColor = [UIColor colorWithRed:0.6 green:0.75 blue:0.6 alpha:1.0];
navController.navigationBar.translucent = NO;
我制作了一个按钮(注意:“完成”指的是关闭 modalviewcontroller 的 IBAction):
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"TEST" style:UIBarButtonItemStyleDone target:self action:@selector(done:)];
我使用该按钮创建一个 navItem:
UINavigationItem *backNavItem = [[UINavigationItem alloc] initWithTitle:@"TESTTEST"];
[backNavItem setRightBarButtonItem:backButton animated:YES];
我尝试添加该按钮:
[navController.navigationBar pushNavigationItem:backNavItem animated:YES];
上面的代码严重失败。我显然无法向 navController 添加按钮,因为:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot call pushNavigationItem:animated: directly on a UINavigationBar managed by a controller.'
我是否必须制作一个单独的 UINavigationBar 以某种方式连接到我的 navController?我尝试走这条路,但没有成功。
最佳答案
我查看了“导航栏”here :
关于如何添加按钮的出色见解。您必须从显示的正确 ViewController 添加按钮。
关于iphone - 呈现模态视图 Controller 后将 BarButtons 添加到 UINavigationBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2569340/
我来自 Asp.Net 世界,试图理解 Angular State 的含义。 什么是 Angular 状态?它类似于Asp.Net中的ascx组件吗?是子页面吗?它类似于工作流程状态吗? 我听到很多人
我一直在寻找 3 态拨动开关,但运气不佳。 基本上我需要一个具有以下状态的开关: |开 |不适用 |关 | slider 默认从中间开始,一旦用户向左或向右滑动,就无法回到N/A(未回答)状态。 有人
我是一名优秀的程序员,十分优秀!