开发者

How to have UISplitViewController appear the same in both orientations

I am writing my first tabbar iPad application to which split view controll开发者_开发问答er 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜