Reputation: 16186
I have a 2-deep menu (UITableView) that is a subview in the main one on the iPad. So, this is not a controller, is a regular UITableView.
However, I want to provide the same visual feedback as with navigation controller, so when a item in the first-level of the table is selected, get push the second and the ability to go back.
This is not in a splitview, and for this UI, a splitview is not the answer. Think as if the table is a box inside a bigger one, with other boxs around.
Upvotes: 3
Views: 326
Reputation: 85
I was able to achieve this by creating a master view controller that held a navigation controller and any of the sub-layer views. I followed the same general principle as found in Apple's DrillDownSave sample except I skipped the Window object and the AppDelegate object in the xib file. I used a UIView instead since I was using a UIViewController to manage everything.
All I had to do after that was create an instance of the master view controller in whatever view I wanted to place it in and set its frame to wherever I wanted it to show up in that view. One interesting issue I ran into was that the navigation controller wanted to span the width of the screen even if its parent view was set smaller. All I had to do was set its width in its frame at the same time I set its master view's frame and everything worked out well.
It's a lot of code to put here but the basic layout goes:
*note - I did not use a leaf view like the Apple example because I didn't need it for my purposes
I don't know if I explained it very well so if you need further clarification let me know. Hope this helps!
Upvotes: 2