I am building an iPad app that has a split view controller. Is it possible to use different images based on vertical or horizontal orientation?
These are table views, so the left side is a root view that calls the detail record.
The root view calls the specific detail record, but I’d like the detail view to control orientation.
Right now in the detail view (viewDidLoad method), I have:
UIInterfaceOrientation fieldOrient = [[UIApplication sharedApplication] statusBarOrientation];
if ((fieldOrient == UIDeviceOrientationLandscapeLeft) || (fieldOrient == UIDeviceOrientationLandscapeRight)) {
self.tableView.backgroundColor = backgroundColor;
self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:horizontalImage]];
} else {
self.tableView.backgroundColor = backgroundColor;
self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:verticalImage]];
}
I was hoping I could get away with the root view setting the detail view backgrounds to nil, but I’m just getting the vertical image shown…
Got it!! woohoo..
Just put the method in the DetailViewController shouldAutorotateToInterfaceOrientation: method.. works great…