0

我使用下面的代码设置状态栏的背景颜色

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0,320, 20)];
    view.backgroundColor = [UIColor colorWithRed:(31.0/255.0) green:(109.0/255.0) blue:(128.0/255.0) alpha:1];
    [self.window.rootViewController.view addSubview:view];
}

我还将情节提要中视图的背景颜色设置为完全相同的颜色(R:31,G:109,B:128)。但结果颜色不一样。状态栏中的背景颜色比视图中的颜色更亮。

在 Info.plist 中,我已Status bar style设置为UIStatusBarStyleLightContentView controller-based status bar appearance设置为NO.

那是因为状态栏是半透明的吗?
我该如何改变呢?
感谢您的任何建议。

4

1 回答 1

0

也许,将导航栏状态更改为不透明:

self.navigationController.navigationBar.translucent = NO;
于 2014-09-15T08:09:58.840 回答