我已经创建了一个XIB
没有使用Status Bar
for的应用程序iOS7
,现在我需要Status bar
在我的应用程序上添加并且Status bar background color
应该与Navigation bar
背景颜色相同。所以我尝试过(在我的info.plist
):
1) Set View controller-based status bar appearance to NO
2) Set Status bar style to UIStatusBarStyleLightContent
这是我的代码App Delegate
:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
[[UINavigationBar appearance] setBackgroundColor:[UIColor colorWithRed:(51/255.0) green:(51/255.0) blue:(51/255.0) alpha:1.0]];
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:(51/255.0) green:(51/255.0) blue:(51/255.0) alpha:1.0]];
所以我得到如下图所示的输出:
我也得到了我在屏幕下方给出的 UIButtons 的错位(它隐藏了 20 个像素)。
你能帮我解决这个问题吗?我需要如下图所示的输出:
任何帮助将不胜感激,谢谢。
第三屏: