如何修复ios 7中的状态栏重叠问题

问题描述:

我正在开发一个在IOS6中运行良好的应用程序。但在iOS7中,状态栏与视图重叠。

I am developing an application that's working fine in IOS6. But in iOS7, the status bar overlaps with the view.

例如:

我首先需要状态栏,然后我的图标和删除最后一个.So请告诉我如何删除重叠。

I need the status bar first, and then my icons and Remove last .So Please give me any idea about how to remove the overlap.

但我需要这个


请告诉我有关我的问题的任何想法

Please give me any idea about my problem

 -(void)viewWillLayoutSubviews{

 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) 
  {
    self.view.clipsToBounds = YES;
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    CGFloat screenHeight = 0.0;
    if(UIDeviceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
        screenHeight = screenRect.size.height;
    else
        screenHeight = screenRect.size.width;
    CGRect screenFrame = CGRectMake(0, 20, self.view.frame.size.width,screenHeight-20);
    CGRect viewFr = [self.view convertRect:self.view.frame toView:nil];
    if (!CGRectEqualToRect(screenFrame, viewFr))
    {
        self.view.frame = screenFrame;
        self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    }
  }
}