iOS隐藏导航栏

隐藏导航栏

方法

 [self.navigationController setNavigationBarHidden:YES];



#pragma mark --判断导航栏是否隐藏

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

{

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

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

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

}


你可能感兴趣的:(objective-c,ios)