I am developing iPad landscape app using storyboard. I have done below steps for same. My app is screen is opening in Landscape on simulator.. But getting wrong frame.
- Sample app template from xcode for storyboard.
- Allow only landscape orientation from info-plist file
- Storyboard -> UIViewController -> Simulated matrices -> Changed orientation to Landscape
Implemented below method in view controller.m
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)); }
Now when I take NSLog of frame and bounds it show me portrait frame.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSLog(@"bounds ::%@",NSStringFromCGRect(self.view.bounds));
NSLog(@"frame ::%@",NSStringFromCGRect(self.view.frame));
}
Result Log :
bounds ::{{0, 0}, {748, 1024}}
frame ::{{20, 0}, {748, 1024}}
Am I missing anything ?