在需要隐藏导航栏的页面添加代码
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[ self . navigationController setNavigationBarHidden : NO animated : YES ];}