@interface WLHomePageController () <UINavigationControllerDelegate>
@end
@implementation WLHomePageController
#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];
}
轉(zhuǎn)自 https://blog.csdn.net/qq_30600895/article/details/52329817