I\'d like to convert my views to work for any orientation (especially since it recommended for iPad). I\'ve been using IB to lay things out, and am not sure how to best pro
You can make two separate views in the same XIB, and then implement the following code:
To @interface
IBOutlet UIView *landscapeView;
IBOutlet UIView *portraitView;
and to @implementation
- (void) viewDidLoad {
self.view.frame = [[UIScreen mainScreen] applicationFrame];
landscapeView.autoresizesSubviews = NO; <- IMPORTANT!
portraitView.autoresizesSubviews = NO; <- IMPORTANT!
}
- (BOOL)shouldAutorotateToInt .... {
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight) self.view = landscapeView;
else if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) self.view = portraitView;
return YES;
}