I use the following code to move up my view 20points when going to landscape:
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)&&
!UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){
NSLog(@"Going LandScape");
self.view.frame = CGRectOffset(self.view.frame, 0, -20);
//self.view.frame = CGRectMake(0, -20, self.view.frame.size.width, self.view.frame.size.height);
}
if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
NSLog(@"Going Portrait");
self.view.frame = CGRectOffset(self.view.frame, 0, 20);
}
}
On all devices except the iPhone 6 (and plus) devil creation, it works as intended, menu bar is keeping constrained and is 20points above(where the view ends) and looks like this at bottom in landscape:
now on the iPhone 6:
note, my menubar is placed within a view that is constrained to bottom of superview. I tried adding this code to viewDidLayoutSubviews in desperation:
NSLayoutConstraint *bottomSpaceConstraint = [NSLayoutConstraint constraintWithItem:self.footerView
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:0.0];
[self.view addConstraint:bottomSpaceConstraint];
that doesn't do anything either.
Please note that on the iPhone 6 the 20point gap is apparent BEHIND the menubar, so it is basically just not respecting the constraint. I have no idea why this only happens on the iPhone 6. Can anybody help me on the subject? Thanks in advance!