我使用下面的代码设置状态栏的背景颜色
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
设置为UIStatusBarStyleLightContent
并View controller-based status bar appearance
设置为NO
.
那是因为状态栏是半透明的吗?
我该如何改变呢?
感谢您的任何建议。