ios - iOS 7 中的 UI 状态栏改变颜色

标签 ios ios7 background uinavigationbar uistatusbar

我正在使用 UINavigationController

对于 rootViewController,我将导航栏设为透明

enter image description here

[self.view setBackgroundColor:[UIColor greenColor]];
self.navigationController.navigationBar.shadowImage = [UIImage new];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];

问题是,当我导航到第二个 viewController 时

enter image description here

[self.navigationController.navigationBar setBackgroundColor:[UIColor greenColor]];

这里我将navigationBar颜色设置回绿色,但是状态栏没有出现在绿色背景中。

是否可以将状态栏背景更改为绿色?

最佳答案

[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x067AB5)];

试试这个 link还有

关于ios - iOS 7 中的 UI 状态栏改变颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22242090/

相关文章:

iphone - SKStoreProductViewController 在 iphone iOS 7 横向应用程序上崩溃

android - Flutter Dart 在构建期间使用过多内存

ios - 通过内容动态设置 UIScrollView 和 UITableView 高度

ios - 如何在单个场景中为 SpriteKit 游戏中的事件发送信号?

objective-c - 在后台运行的 iPhone 应用程序可以通过网络将数据发送到远程服务器吗?

android - 如何确保更改所选 GridView 单元格的背景?

Android按钮背景变化

ios - 正在使用performSelector :afterDelay: the most efficient way to queue or order methods?

ios - 将数据从子 Controller 传递回父 Controller

javascript - iOS 7 中的跨域 cookie