iOS - 导航栏的正确隐藏方式
@interface WLHomePageController () <UINavigationControllerDelegate>
@end
@implementationWLHomePageControlle
r#pragma mark - lifeCycle
- (void)viewDidLoad {
[superviewDidLoad];
// 设置导航控制器的代理为
selfself.navigationController.delegate=self;
}
#pragma mark - UINavigationControllerDelegate
// 将要显示控制器
- (void)navigationController:(UINavigationController*)navigationController willShowViewController:(UIViewController*)viewController animated:(BOOL)animated {
// 判断要显示的控制器是否是自己
BOOLisShowHomePage = [viewController isKindOfClass:[selfclass]];
[self.navigationControllersetNavigationBarHidden:isShowHomePage animated:YES];
}
本文标题:iOS - 导航栏的正确隐藏方式
本文链接:https://www.haomeiwen.com/subject/zaadnhtx.html
网友评论