Skip to content

Commit

Permalink
Take tab bar into account when calculating available view size.
Browse files Browse the repository at this point in the history
  • Loading branch information
maikg committed Mar 3, 2011
1 parent f48c4dd commit 47e9bac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/MGSplitViewController.m
Expand Up @@ -235,6 +235,11 @@ - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation
if ((self.navigationController)&&(!self.navigationController.navigationBarHidden)) {
navigationBarHeight = self.navigationController.navigationBar.frame.size.height;
}

CGFloat tabBarHeight = 0;
if (self.tabBarController) {
tabBarHeight = self.tabBarController.tabBar.frame.size.height;
}

// Initially assume portrait orientation.
float width = fullScreenRect.size.width;
Expand All @@ -249,6 +254,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;
height -= tabBarHeight;

return CGSizeMake(width, height);
}
Expand Down

0 comments on commit 47e9bac

Please sign in to comment.