Objective c iOS 6和iOS 7状态栏

Objective c iOS 6和iOS 7状态栏,objective-c,ios7,ios6,Objective C,Ios7,Ios6,从iOS 6状态栏切换到iOS 7有很多问题,但我想问的是相反的问题 我的问题是:如何使iOS 6屏幕在状态栏下滑动?我试图在App Delegate中移动self.window.frame和self.window.bounds,可以在状态栏下上移,但底部会留下一条20~40px的黑线 代码如下: if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6 && [[[UIDevice currentDevi

从iOS 6状态栏切换到iOS 7有很多问题,但我想问的是相反的问题

我的问题是:如何使iOS 6屏幕在状态栏下滑动?我试图在App Delegate中移动self.window.frame和self.window.bounds,可以在状态栏下上移,但底部会留下一条20~40px的黑线

代码如下:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6 && [[[UIDevice currentDevice] systemVersion] floatValue] < 7) {
    [application setStatusBarStyle:UIStatusBarStyleLightContent];
    self.window.clipsToBounds = YES;
    self.window.frame =  CGRectMake(0, -20, self.window.frame.size.width, self.window.frame.size.height + 40);
    self.window.bounds = CGRectMake(0, -40, self.window.frame.size.width, self.window.frame.size.height + 80);
}
我尝试了许多价值观,但都不符合我的需要。我错过了什么?我想我很接近了

这是我想要实现的模拟屏幕截图,我知道iOS 6的信号状态不是这样的。只是为了表明这个想法


注意:只需要支持iOS 6+

我的最终解决方案是删除App Delegate中的代码,并将IBOutlet添加到每个页面的标题图像中

然后,在-voidviewDidLayoutSubviews方法中:

如果情况定义为:

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)