0
  if ([[[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-20);
    }

我正在使用这段代码,它会调整状态栏,但是当我展示任何视图控制器时,它会出现问题。

4

2 回答 2

0

如果它嵌入在 UINavigationController 中,则在您的视图控制器中使用它

- (void)viewDidLoad{
    //add this 2 lines:
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;

    [super viewDidLoad];
}
于 2013-11-11T11:22:35.610 回答
0

在 iOS 7 中,状态栏是透明的,它不是窗口的一部分,希望你能理解这一点。

于 2013-11-11T11:18:16.923 回答