【发布时间】:2014-09-15 07:55:50
【问题描述】:
我使用下面的代码设置状态栏的背景颜色
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。
是因为状态栏是半透明的吗?
我该如何改变呢?
感谢您的任何建议。
【问题讨论】:
标签: ios objective-c ios7-statusbar