iOS7中的状态栏背景色
我正在开发一款与ios6兼容的应用程序。在iOS 7中,状态栏是重叠视图和导航栏。我想要iOS 6风格的状态栏。它应该出现在所有UI对象、视图、Viewcontroller和导航控制器之上。我们如何才能做到这一点 要解决重叠问题,请尝试此链接 对于使用类似于ios 6的状态栏样式,此链接可能会帮助您 在应用程序代理的ApplicationIDFinishLaunching方法中:iOS7中的状态栏背景色,ios7,uistatusbar,ios7.1,ios7-statusbar,Ios7,Uistatusbar,Ios7.1,Ios7 Statusbar,我正在开发一款与ios6兼容的应用程序。在iOS 7中,状态栏是重叠视图和导航栏。我想要iOS 6风格的状态栏。它应该出现在所有UI对象、视图、Viewcontroller和导航控制器之上。我们如何才能做到这一点 要解决重叠问题,请尝试此链接 对于使用类似于ios 6的状态栏样式,此链接可能会帮助您 在应用程序代理的ApplicationIDFinishLaunching方法中: [[UIApplication sharedApplication] setStatusBarStyle: UISt
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];
设置UIStatusBarStyleBlackTranslucent/UIStatusBarStyleBlack不透明,以获得类似于iOS6的状态栏
希望这能对你有所帮助我回答这个问题已经晚了,但我只想分享我所做的,基本上是 最简单的解决方案 首先->转到您的
info.plist
文件,添加状态栏样式->透明黑色样式(Alpha为0.5)
现在,它来了:-
在AppDelegate.m中添加此代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Whatever your code goes here
if(kDeviceiPad){
//adding status bar for IOS7 ipad
if (IS_IOS7) {
UIView *addStatusBar = [[UIView alloc] init];
addStatusBar.frame = CGRectMake(0, 0, 1024, 20);
addStatusBar.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; //change this to match your navigation bar
[self.window.rootViewController.view addSubview:addStatusBar];
}
}
else{
//adding status bar for IOS7 iphone
if (IS_IOS7) {
UIView *addStatusBar = [[UIView alloc] init];
addStatusBar.frame = CGRectMake(0, 0, 320, 20);
addStatusBar.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; //You can give your own color pattern
[self.window.rootViewController.view addSubview:addStatusBar];
}
return YES;
}