navigationBar 的颜色可以通过 self.navigationController.navigationBar.barTintColor = [UIColor redColor] 更改,但是更改后的颜色 不是实际颜色,比设置的颜色稍微浅一点。是因为navigationBar 有一层 blur 的效果,关掉就好了。
<span style="white-space:pre"> </span>[[UINavigationBar appearance] setTranslucent:NO];
[[UINavigationBar appearance] setBarTintColor:ECOLOR];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];