我们这个项目的需求是主界面的导航栏不显示
self.navigationController.navigationBarHidden = YES; 所以在viewDidLoad里面写这句
要想点击tabar后再返回并且隐藏导航栏 只需要
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = NO;
}
//隐藏返回按钮的文字
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
forBarMetrics:UIBarMetricsDefault];
就可以了!