我用以下代码呈现我的视图控制器:
UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:sessionController];
[self presentViewController:navigation animated:YES completion:^{
}];
在我提出的视图控制器的“viewDidLoad”方法中,我试图设置“后退按钮”,如下所示:
UIBarButtonItem *newBackButton =
[[UIBarButtonItem alloc] initWithTitle:@"Test"
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
[self.navigationController.navigationItem setBackBarButtonItem:newBackButton];
无声失败,无异常,无日志,无错误,无按钮。任何想法将不胜感激!
你可以试试:
self.navigationItem.leftBarButtonItem = newBackButton