美文网首页
(IOS)隐藏导航栏

(IOS)隐藏导航栏

作者: rightmost | 来源:发表于2020-04-25 05:54 被阅读0次

    @interfaceWLHomePageController() 

    @end

    @implementationWLHomePageController

    #pragma mark - lifeCycle

    - (void)viewDidLoad {

        [super viewDidLoad];

        // 设置导航控制器的代理为self

        self.navigationController.delegate = self;

    }

    #pragma mark - UINavigationControllerDelegate

    // 将要显示控制器

    - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {

        // 判断要显示的控制器是否是自己

        BOOL isShowHomePage = [viewController isKindOfClass:[self class]];

        [self.navigationController setNavigationBarHidden:isShowHomePage animated:YES];

    }

    - (void)dealloc {

        self.navigationController.delegate = nil;

    }

    相关文章

      网友评论

          本文标题:(IOS)隐藏导航栏

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