实现这样的效果,所有文字包括返回按钮都为白色
- (void)changeNav
{
//设置NavigationBar背景颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.1136 green:0.6474 blue:0.9986 alpha:1.0]];
//@{}代表Dictionary
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateNormal];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
//不设置这个无法修改状态栏字体颜色
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
}
自定义返回按钮
记得要写在上一个页面上
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationItem.backBarButtonItem = item;