想要隐藏后退按钮导航栏,我已经尝试过以下所有语句,但它们都没有为我工作
[self.navigationController.navigationItem setHidesBackButton:YES]; //1
[self.navigationController.navigationBar.backItem setHidesBackButton:YES]; //2
self.navigationController.navigationItem.hidesBackButton = TRUE; //3
[self.navigationItem setHidesBackButton:YES animated:YES]; //4
self.navigationItem.hidesBackButton = NO; //5
答案 0 :(得分:6)
试试这个,
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.leftBarButtonItem=nil;
self.navigationItem.hidesBackButton=YES;
}
答案 1 :(得分:2)
试试这个:
[self.navigationController.topViewController.navigationItem setHidesBackButton:YES];
答案 2 :(得分:0)
试着看你的第5个声明,你已经设置为NO所以请改变它。它会正常工作。
self.navigationItem.hidesBackButton = YES; //5