Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 884 Bytes

README.md

File metadata and controls

24 lines (22 loc) · 884 Bytes

JMHiddenNavigationController

iOS 隐藏导航相互跳转出现黑块,解决方案

关键代码

///导航代理 基类封装 在一个导航下导航公用
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
    ///设置需要隐藏的导航类数组
    [self setHiddenNavVCArr];
    
    BOOL isHiddenNav = NO;
    for (NSString *classStr in self.navigationController.hiddenVCNameArr) {
        if ([viewController isKindOfClass:NSClassFromString(classStr)]) {
            isHiddenNav = YES;
        }
    }
    ///判断并隐藏导航
    [navigationController setNavigationBarHidden:isHiddenNav animated:YES];
    if (isHiddenNav) {
        ///打开左滑返回手势
        self.navigationController.interactivePopGestureRecognizer.delegate = self;
    }
}