当视图控制器被按下时,如何使 rightBarButtonItem 保持不动?
当我将视图推到视图控制器上时,
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; [self.navigationController pushViewController:anotherViewController animated:YES]; }
导航控制器的右侧按钮项消失。
有没有办法让 self.navigationController.rightBarButtonItem 保持像 iPhone 附带的“Notes”应用程序一样?
When I push a view onto my view controller
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; [self.navigationController pushViewController:anotherViewController animated:YES]; }
the RIGHT BUTTON ITEM of the navigationController DISAPPEARS.
Is there a way to make the self.navigationController.rightBarButtonItem
STAY THERE like in the "Notes" application that comes with the iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信你不使用未记录的类就可以。但是,如果将
rightBarButtonItem
属性设置为看起来相同的项目,则应该不会有太大差异。I don't believe you can without using undocumented classes. However, if you set the
rightBarButtonItem
property to an item that looks the same, there shouldn't be a big difference.执行此操作
您可以在推送 ChildViewController 后
You can do that with
after you´ve pushed the ChildViewController