I have a storyboard with 1 UIViewControllerholding 1 UIViewthat contains several nested UIViews. I subclassed the View controller to implement this method:
- (BOOL)shouldAutorotateToInterfaceOrientation: UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
I also added
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
c Info.plist.
In the viewDidLoad of the main UIView, I do this:
PASectionView* sectionView = [[PASectionView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 180)];
[self addSubview:sectionView];
The problem is that only 756px is used for control instead of the expected 1024. For more details, see the screenshot below.
I searched all over the network, but I canβt find a solution to this annoying problem anywhere. I am using Xcode 4.5 with iOS5.1 installed as the base SDK.
EDIT
It works by replacing frames with frames. However, I do not understand what is happening, so it does not work with the frame size.