I'm facing an issue which is caused by orientation magic I don't understand. First, I'm using a NavigationController which loads a ViewController. In this ViewController is a ScrollView. When I ask for the position of the ScrollView, I get wrong data. For example: The x coordinate of the ScrollView is 90 in the interface builder. If I get the frame of the ScrollView programmatically it returns 280. Everything in the App is set to landscape. In the Info.plist, in the summary, in the implementation of the ViewControllers, in the interface builder.
I made some screenshots. Maybe are they helping finding the mistake.
And every ViewController has this:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
If I remove the NavigationController from the Storyboard and leave the simulated metrics to inferred, then the first ViewController swaps to portrait in the Storyboard.
When I log the size of the view from the NavigationController is it in portrait
NSLog(@"frame %@", NSStringFromCGRect(self.view.frame));
The output is 768x1024