0 votes
851 views
asked in xCode by (3.1k points)
edited by
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 by (8.2k points)
edited by

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);

        }

    }

 

Categories

...