本人在做一个功能的时候出现这样的一个问题。本人在UITabBarViewController页面中的VC中push到下一个页面后。push后的页面中怎么样去隐藏导航栏中的横线。本人在UITabBarViewController页面中的VC中使用这个代码方法进行隐藏导航栏和导航栏横线
#pragma mark - 视图将要出现
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setTranslucent:YES];
//导航栏背景
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bargound.png"] forBarMetrics:UIBarMetricsDefault];
//导航栏底部线
self.navigationController.navigationBar.shadowImage =[UIImage imageNamed:@"nav_bargound.png"];
}
#pragma mark - 视图将要消失
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
//导航栏背景
[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
//导航栏底部线
self.navigationController.navigationBar.shadowImage =[UIImage imageNamed:@""];
}
可是本人在push的那个页面中也使用这个方法无法隐藏导航栏的横线 甚至试过了全部本人找到的方法都没办法去隐藏掉。
解决方案
80
自定义导航栏吧!