GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
My hierarchy consists of a UINavigationController which contains the MGSplitViewController and then inside the MGSplitViewController I have another UINavigationController in the masterView and a UIViewController in the detailView. Then inside the second UINavigationController I have a series of UITableViews.
Whenever I display the first UITableView, whenever I'm in landscape, the UITableView is 44px too tall (the height of a navigation bar). If I change orientations and change back, the view renders correctly.
What I have found out, is that [MGSplitViewController splitViewSizeForOrientation:] returns the correct size every time, but if print out the actual height of the UITableView after it loads (or changes orientation) the height is incorrect by 44px on load. On load the UITableView is 748px tall but after an orientation change it is 704px tall for landscape.
I've tried loading the second UINavigationController on its own and I've tried loading the first UITableView without the UINavigationController, and I've tried just loading the UITableView on its own. As soon as I remove MGSplitViewController from the hierarchy everything renders correctly.
So far my workaround has been to just keep track of the first time [MGSplitViewController layoutSubviewsForInterfaceOrientation:withAnimation:] and subtract the height of the navigation bar from the masterView, if it's in landscape orientation, otherwise calculate the dimensions normally.