//设置导航栏透明 [self.navigationController.navigationBar setTranslucent:true]; //把背景设为空 [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; //处理导航栏有条线的问题 [self.navigationController.navigationBar setShadowImage:[UIImage new]]; //1。 [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];//设置NavigationBar上的title的颜色 //2. [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
//视图将要出现,隐藏导航栏
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES];
}