I would like obtain a SplitView on my iPad application with my left menu in a portrait orientation such as iPad settings. For now in portrait orientation I have a content view in full screen and I have a button at NavigationBar which includes a popover with my left menu.
32
votes
8 Answers
50
votes
This is the magic you need:
This method is in UISplitViewControllerDelegate, available on iOS 5.0
- (BOOL)splitViewController: (UISplitViewController*)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
{
return NO;
}
11
votes
You should definitely have a look at Matt Gemmell's MGSplitViewController.
MGSplitViewController is an open source replacement for UISplitViewController, with various useful enhancements.
9
votes
8
votes
6
votes
5
votes
4
votes
some people asked me the same question on our blog and I found a solution for that. You will find it at the end of my blog post Your first split view controller | Seaside.
In general, all you have to do is to create a subclass of UISplitViewController
and override the method willAnimateRotationToInterfaceOrientation: duration:
and adjust your master and detail views when the interface orientation will change to portrait mode.
Cheers, Andreas