Reputation: 1044
I'd like to make a menu layout like this:
I've considered doing it with this hierarchy:
UITableView (Whole menu)
-UITableViewCell (Each Category, for example Category 3)
-UITableView (Each Category, for example Category 3)
-UITableViewCell (Category items, for example item 2)
-UITableView (Category items, for example item 2)
-UITableViewCell (item sub-rows, for example item 2(#1))
As shown in this diagram:
Some things that are important:
Does this many nested UITableViews and UITableViewCells make sense? Is this the most appropriate way to achieve a layout like this? And does my proposed hierarchy seem accurate for this design?
EDIT:
If I use just 1 UITableView and 3 types of cell, will I be able to achieve the functionality I need? Can I add rows, then collapse the category, then expand the category again (and the added rows will still be there), and then remove cells?
Upvotes: 2
Views: 980
Reputation: 224
No need to use nested TableViews if you don't need scrollable content, instead use sections and make them expandable and collapsable as per your need.
Upvotes: 0
Reputation: 1675
Why do we use UITableView
? IMHO mostly for these reasons:
So according to these points I'd say it's better to use just one UITableView
for your case. (Can't say, your way not OK because you actually can make it work)
Upvotes: 1