按此方法修改背景色
- (void)viewWillAppear:(BOOL)animated
{
[superviewWillAppear:animated];
[self.navigationControllersetNavigationBarHidden:NO];
}
//修改背景颜色
[[UINavigationBarappearance]setBackgroundColor:LIGHTGBLUECOLOR];
[[UINavigationBarappearance]setBarTintColor:LIGHTGBLUECOLOR];
//修改返回按钮字体颜色
self.navigationController.navigationBar.tintColor= [UIColorwhiteColor];
//修改返回按钮文字
self.navigationItem.backBarButtonItem= [[UIBarButtonItemalloc]initWithTitle:@"返回"style:UIBarButtonItemStylePlaintarget:nilaction:nil];
//修改导航栏标题颜色
self.navigationController.navigationBar.titleTextAttributes=@{NSForegroundColorAttributeName:[UIColorwhiteColor],NSFontAttributeName:[UIFontboldSystemFontOfSize:17]};
self.view.backgroundColor=LIGHTGGRAYCOLOR_BG;
self.navigationController.navigationBar.translucent=NO;
}
网友评论