首页 文章

当推动视图控制器时,如何使rightBarButtonItem保持不变?

提问于
浏览
0

当我将视图推送到我的视图控制器时

- (void)tableView:(UITableView *)tableView
        didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
  AnotherViewController *anotherViewController = 
      [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
  [self.navigationController pushViewController:anotherViewController animated:YES];
}

navigationController DISAPPEARS的右键按钮项目 .

有没有办法让 self.navigationController.rightBarButtonItem STAY在iPhone附带的"Notes"应用程序中?

2 回答

  • 0

    我不相信你可以不使用未记录的课程 . 但是,如果将 rightBarButtonItem 属性设置为看起来相同的项目,则应该没有太大区别 .

  • 0

    你可以这样做

    self.anotherViewController.navigationItem.rightBarButtonItem = self.parentViewController.navigationItem.rightBarButtonItem;
    

    你推了ChildViewController之后

相关问题