Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS table view inside of a table view

I have a table view with expanding cells for each of them. I want to make every expanding cell be a new table inside of the bigger one. Is that possible? I've done the research, someone said that duplicate UITableView cannot put in one file.

For example

dish order1

=================

dish order2


rice


coke

===============

dish order3

which every "dish order #" is a cell of a table, and when you expand one cell, there will be a smaller table appears. I've done all the expanding stuff. But don't know how to put a small table into a bigger one. Thanks

like image 864
tracer_rock Avatar asked Jan 12 '23 08:01

tracer_rock


2 Answers

Well if i understand your question correctly, what you search is called nested tableView, here's some examples:

  • SDNestedTable
  • ExtensiveCell
  • CollapseClick
  • JKExpandTableView

Good luck.

like image 59
ignotusverum Avatar answered Jan 24 '23 03:01

ignotusverum


It would likely be impossible to put one table view inside of another table view, and if you did manage to do it, it would be awful. Ask yourself, have you EVER seen this in a commercial app? If not, as a novice iOS developer, you are out of your depth trying to invent new UI paradigms.

Master the existing UI tools first. Don't try to use the UI elements in totally novel ways until you have a strong feel for the standard way to use them. Expect this to take 6 months or more.

Others have suggested a sectioned table view where initially only the first element of a section is visible, but when you tap on it, it expands to add other rows. This works quite well.

Another approach would be to use a master/detail UI, where tapping on one table view cell pushes a new view controller the uses a new table view to display detail information about the previously selected item. There are some use cases where you might have several levels of increasing detail.

like image 30
Duncan C Avatar answered Jan 24 '23 05:01

Duncan C