mattgemmell/MGSplitViewController — Issue #52: splitViewSizeForOrientation needs to account for navBar
Author: sbonami
Created: 2011-12-31 04:32:31+00:00
State: open

I found that the navBar height was not being subtracted from the height of the master view, affecting a custom tabbar. Added the following code to make that work:

```
- (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation
{

// Other code

// Account for status bar, which always subtracts from the height (since it's always at the top of the screen).
height -= statusBarHeight;

// new code
if (!self.navigationController.navigationBarHidden) {
height -= self.navigationController.navigationBar.frame.size.height;
}
// end new code

return CGSizeMake(width, height);

}}
```