解決方法 1:
自從IOS7后UINavigationBar的一些屬性的行為發(fā)生了變化.你可以在下圖看到:
背景顏色
self.navigationController.navigationBar.barTintColor = [UIColor blackColor];\
//去掉導(dǎo)航條的半透明\
Navbar.translucent=YES;
按鈕顏色(返回按鈕的顏色設(shè)置)
[[UINavigationBarappearance]setTintColor:[UIColorwhiteColor]];
或者
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
標(biāo)題字體和顏色:
[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];