StatusBar overLapping in iOS 7.0 and above

0 votes
844 views
asked Oct 16, 2013 in xCode by jonathan (3,105 points)
edited Oct 16, 2013 by admin
Hi All

   Everthing work fine upto ios6.0, in the new version of io 7.0 my status bar overlapping the views..

It's tollay annoying my application..please provide the solution?

1 Answer

0 votes
answered Oct 16, 2013 by admin (8,115 points)
edited Dec 23, 2013 by admin

Use this piece of code

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))    {

[application setStatusBarStyle:UIStatusBarStyleLightContent];

 self.window.clipsToBounds =YES;

 

        UIDeviceOrientation deviceOrientaion = [[UIDevice currentDevice] orientation];

        if(deviceOrientaion == UIDeviceOrientationLandscapeLeft){

            self.window.frame = CGRectMake(-20, 0, self.window.frame.size.width, self.window.frame.size.height);

        }else if(deviceOrientaion == UIDeviceOrientationLandscapeRight){

            self.window.frame = CGRectMake(20, 0, self.window.frame.size.width, self.window.frame.size.height);

        }else if(deviceOrientaion == UIDeviceOrientationPortrait){

            self.window.frame = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);

        }else if(deviceOrientaion == UIDeviceOrientationPortraitUpsideDown){

            self.window.frame = CGRectMake(0, -20, self.window.frame.size.width, self.window.frame.size.height);

        }

    }

 

...