使用代理隐藏当前控制器的导航栏 <UINavigationControllerDelegate>
self.navigationController.delegate = self;
//隐藏导航栏,将要显示控制器
- (void)navigationController:(UINavigationController*)navigationController willShowViewController:(UIViewController*)viewController animated:(BOOL)animated {
//判断要显示的控制器是否是自己
BOOL isShowHomePage = [viewController isKindOfClass:[self class]];
[self.navigationController setNavigationBarHidden:isShowHomePage animated:YES];
}
网友评论