Permalink
Browse files

Fix bug where MGSplitViewController is messed in Landscape on iOS 6.

  • Loading branch information...
1 parent b92d645 commit f218a799b06afa641d36027bf389990722a76ace @jgale committed Sep 17, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 Animations/FirstViewController.m
@@ -64,13 +64,19 @@ - (void)viewDidLoad
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor clearColor];
+ label.adjustsFontSizeToFitWidth = YES;
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.text = @"Includes “MGSplitViewController” code by Matt Gemmell.";
[self.view addSubview:label];
SplashViewController *splashScreen = [[SplashViewController alloc] init];
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+ // Hack for iOS 6 on iPad. Need this to get the split view to display properly on iOS 6 when opened in Landscape
+ // https://github.com/mattgemmell/MGSplitViewController/issues/69
+ [appDelegate.splitViewController setSplitPosition:appDelegate.splitViewController.splitPosition - 1];
+ [appDelegate.splitViewController setSplitPosition:appDelegate.splitViewController.splitPosition + 1];
+
// This will never let me see the view underneath :(
//[appDelegate.window.rootViewController presentModalViewController:splashScreen animated:NO];
[appDelegate.window addSubview:splashScreen.view];

0 comments on commit f218a79

Please sign in to comment.