iOS 设置导航栏对当前控制器隐藏

遵循代理

<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];
}

猜你喜欢

转载自blog.csdn.net/weixin_34228617/article/details/87271973