Reputation: 429
I'm looking to create a menu with collapsible submenus in my iOS app. It should look something like this:
Main menu item 1
Submenu item 1
Submenu item 2
Submenu item 3
Main menu item 2
Submenu item 1
Submenu item 2
I don't want the drill-down approach Apple does with UINavigationController
since the submenus are few (1-3) and have very short titles. I also want to be able to collapse or expand submenus when a corresponding main menu item is tapped.
I don't see how I can coax UITableView
to do this so I'm thinking I have to do my own control unless someone has a better idea.
Upvotes: 2
Views: 1352
Reputation: 3547
This is a sample code from Apple, have a look and create one which you need here
Upvotes: 5
Reputation: 30846
You could use a sectioned table view where the section headers are actually your main menu items. The cells in that section would correspond to your submenu items. Use tap gestures on the section headers to expand and contract.
Upvotes: 0