解决方法 1:
自从IOS7后UINavigationBar的一些属性的行为发生了变化.你可以在下图看到:
背景颜色
self.navigationController.navigationBar.barTintColor = [UIColor blackColor];\
//去掉导航条的半透明\
Navbar.translucent=YES;
按钮颜色(返回按钮的颜色设置)
[[UINavigationBarappearance]setTintColor:[UIColorwhiteColor]];
或者
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
标题字体和颜色:
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor clearColor]} forState:UIControlStateNormal];
去掉返回按钮的字:
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:self.navigationItem.backBarButtonItem.style target:nil action:nil];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];