Two similar questions have been asked here before:
Forcing an iPad app to show splitView even in Portrait orientation(Like the Settings iPad app)
Both questions were largely answered with “not officially supported – roll your own or use a third-party custom controller”
However, I’m digging through WWDC 2011 Apple Developer videos (Session 102, specifically), and about 30 minutes in the presenter declares that this feature now is supported in iOS 5. The problem is that I don’t know how to implement it. Here’s the code from the slide:
@protocol UISplitViewControllerDelegate
...
// Returns YES if a view controller should be hidden by
// the split view controller in a given orientation.
// (This method is only called on the leftmost view controller
// and only discriminates portrait from landscape.)
- (BOOL)splitViewController: (UISplitViewController*)svc
shouldHideViewController:(UIViewController *)vc
inOrientation:(UIInterfaceOrientation)orientation;
@end
So – what do I do with this?
I read through a bunch of stuff and actually found the way to do it correctly now. Go to your
detailViewController. YourdetailViewControllershould haveUISplitViewControllerDelegate. And simply just drop this code in:This will make all the view stay in place. Let me know, if it works for you.