I added the following code in the AppDelegate implementor function didFinishLaunchingWithOptions
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);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidChangeStatusBarOrientation:)
name:UIApplicationDidChangeStatusBarOrientationNotification
object:nil];
}
as well as this function that is being called:
- (void)applicationDidChangeStatusBarOrientation:(NSNotification *)notification
{
int a = [[notification.userInfo objectForKey: UIApplicationStatusBarOrientationUserInfoKey] intValue];
int w = [[UIScreen mainScreen] bounds].size.width;
int h = [[UIScreen mainScreen] bounds].size.height;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
UIDeviceOrientation orientationa = [[UIDevice currentDevice] orientation];
if (orientation==4)
{
self.window.frame = CGRectMake(20,0,w-20,h+20);
}else if(orientation==1)
{
self.window.frame = CGRectMake(0,20,w,h);
}else
{
self.window.frame = CGRectMake(-20,0,w+20,h+20);
}
}
This works with getting the status bar to not overlap even when rotating but when clicking on a button that makes a request to the backend it changes and overlaps until it is rotated again, anyone knows why this might happen? I suspect it could be something to do with the ECSlidingViewController?