Split view controller does not function properly when added as a subview of another view #10

indragiek opened this Issue Aug 3, 2010 · 8 comments


None yet
8 participants

It will only work when added as a subview of the main application window. If you add it as a subview of another view (even if the view is fullscreen), things start falling apart.


mattgemmell commented Aug 3, 2010

Planned future enhancement. Likely to be significantly improved by a reimplementation of the -splitViewSizeForOrientation: method.

jdmuys commented Mar 5, 2011

Has any progress been made since that answer? I want to have a split view inside one tab of my tab bar application, and I'd rather not reinvent...

Man, I should have come here first before spending hours on this!

Is this the same problem as from example code: using UIViewController instead of UITableViewController.
RootViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
Later add it to UITableView, it has problem on landscape because the table cell extend all the way to full screen.

Any progress with this issue?

Grab your copy of the code and replace -splitViewSizeForOrientation: with a version that returns a rectangle instead of a size. Let it return the rect you are planning to use. Then you need to adust -layoutSubviewsForInterfaceOrientation: to inset the master and detail view according to your rect. The "fullSize" should be the size of the rectangle.
The "newFrame" also has to be the rectangle you return. Then you still need to adjust the corner views and that's it.

FYI: I'm the writer of MTSplitViewController, a Monotouch port of MGSplitViewController and the Monotouch version offers this feature.

Great, thanks for help!

Can any body update this code because i also want MGSplitViewController inside a tabbar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment