Question

I am writing my first tabbar iPad application to which split view controller is added. Everything is working fine but the problem is I am trying to display the root view controller and detail view controller whenever the view gets loaded in portrait mode. To be very clear, I need two controllers to appear the same way as they would appear in landscape mode. Please let me know guys, if there is a way to do it or any other thoughts you have so that it will be helpful for me.

I look at MGSplitViewController but left it as a last option.

Thanks for your time.

Was it helpful?

Solution

What I did was to add a TableView inside the Detail View (the table View that would be displayed in Portrait Mode). I hooked this TableView to my data source so the same data would be displayed. And when the App rotates to landscape I just set the alpha of the TableView to 0 in willRotateToInterfaceOrientation, and back to 1 when it rotates to Portrait.

The only disadvantage is that there is a warning when you hook up two tables to the same data source "already has a child fulfilling this role". But its just a warning, my App is already in iTunes store and running fine without crashes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top