diff --git a/Classes/MGSplitViewController.m b/Classes/MGSplitViewController.m index 61b30a6..a66dee5 100644 --- a/Classes/MGSplitViewController.m +++ b/Classes/MGSplitViewController.m @@ -231,6 +231,11 @@ - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation // Little bit ugly looking, but it'll still work even if they change the status bar height in future. float statusBarHeight = MAX((fullScreenRect.size.width - appFrame.size.width), (fullScreenRect.size.height - appFrame.size.height)); + float navigationBarHeight = 0; + if ((self.navigationController)&&(!self.navigationController.navigationBarHidden)) { + navigationBarHeight = self.navigationController.navigationBar.frame.size.height; + } + // Initially assume portrait orientation. float width = fullScreenRect.size.width; float height = fullScreenRect.size.height; @@ -243,6 +248,7 @@ - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation // Account for status bar, which always subtracts from the height (since it's always at the top of the screen). height -= statusBarHeight; + height -= navigationBarHeight; return CGSizeMake(width, height); }