我正在使用 UINavigationController
对于 rootViewController
,我将导航栏设为透明
[self.view setBackgroundColor:[UIColor greenColor]];
self.navigationController.navigationBar.shadowImage = [UIImage new];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
问题是,当我导航到第二个 viewController 时
[self.navigationController.navigationBar setBackgroundColor:[UIColor greenColor]];
这里我将navigationBar
颜色设置回绿色,但是状态栏没有出现在绿色背景中。
是否可以将状态栏背景更改为绿色?
最佳答案
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x067AB5)];
试试这个 link还有
关于ios - iOS 7 中的 UI 状态栏改变颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22242090/