开发者

iPad split controller that doesn't hide the left pane in portrait

开发者 https://www.devze.com 2022-12-29 00:41 出处:网络
I am trying to implement a split view controller like UISplitViewController on the iPad, but I don\'t want the left pane to be hidden when the device is in portrait orientation.

I am trying to implement a split view controller like UISplitViewController on the iPad, but I don't want the left pane to be hidden when the device is in portrait orientation.

So I've created a UIViewController subclass for this in IB and it works fine w开发者_JAVA技巧ithout any sub-view controllers. Now I'm trying to wrap my head around what is required to setup and manage the two UIViewController objects for the left and right panes. In my app, they are going to both be UINavigationController with a UITableView in them.

I've hit a mental road block about how to set this up and was hoping someone could point me to some sample code or give me a recommendation for architecture here...


The only reason to use the UISplitView controller is the show/hide logic it gets you for free. I would think it a lot easier to simply take the two view controllers (Root View & Detail View) and lay them on a standard UIViewController. You can then manage them more diorectly without overriding the intended behavior of the implemented controller.

THe settings app on the iPad does what you are looking for and I believe this is the approach that app takes.

Good Luck!


is setHidesMasterViewInPortrait still a private Api and the app will get rejected?


Create your UISplitViewController instance and then call:

 [splitViewController setHidesMasterViewInPortrait:NO];

The compiler will give you a warning message but it will do what you want. You can get rid of the compiler warning by making a category on UISplitViewController that implements that method.

0

精彩评论

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

关注公众号