美文网首页
iOS Tabbar一级页面有导航栏和无导航栏页面切换时,无导航

iOS Tabbar一级页面有导航栏和无导航栏页面切换时,无导航

作者: XieHenry | 来源:发表于2022-05-16 10:59 被阅读0次

    之前隐藏导航是:

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        [self.navigationController setNavigationBarHidden:YES animated: YES];
    }
    
    -(void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
        [self.navigationController setNavigationBarHidden:NO animated:YES];
    }
    

    只需要讲动画属性设置为animated即可,如下:

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        [self.navigationController setNavigationBarHidden:YES animated:animated];
    }
    
    -(void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
        [self.navigationController setNavigationBarHidden:NO animated:animated];
    }
    

    相关文章

      网友评论

          本文标题:iOS Tabbar一级页面有导航栏和无导航栏页面切换时,无导航

          本文链接:https://www.haomeiwen.com/subject/wcniurtx.html