今天遇到设置:
self.navigationController.navigationBarHidden= YES;
点击返回上一个UIViewController的时候这个时候这个navigationController也隐藏了
解决办法:
self.navigationController.delegate = self;
#pragma mark -UINavigationControllerDelegate
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if([viewController isKindOfClass:[self class]])
{
[navigationController setNavigationBarHidden:YES animated:animated];
}
else if([navigationController isNavigationBarHidden])
{
[navigationController setNavigationBarHidden:NO animated:animated];
}
}
时间: 2024-12-27 00:49:07