I have an app where I only support landscape orientation, it works great in ios6 but in ios5 some of the subviews appear to have portait coordinates and sizes. I have put
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
everywhere I can imagine, yet these views seem stuck to portait, my width param seems to be the height and vice versa.
The main view for the appear appears to be correct but some subviews seem wrong especially ones that calculate their position and size from other elements, I am afraid to swap the dimensions since this would break ios6 and i dont want to do any conditional code if I can avoid it.
Has anyone seen this? I read a few other questions but they seemed to deal with handling the rotation, but in my case i am not rotating.
Basically in my viewDidLoad for my navigation controller
my frame has:
2013-01-10 17:14:29.445 EdwardsSync[29070:c07] Width:: 768.000000
2013-01-10 17:14:29.445 EdwardsSync[29070:c07] Height:: 1024.000000
even though it appears in landscape. This is true of frame and bounds.
interesting if I wait till viewDidAppear the coordinates are correct.
is there a way to tell my app the orientation sooner?
Also go into the xib in Interface Builder and adjust the dimensions of the view. Properties under view select Orientation Landscape. It’s under Simulated Metrics. Also Size Metrics you can specify 1024 x 768, etc.
In Build Settings remove the Portrait Views if you want.