Nested UITableView inside another nested table

匿名 (未验证) 提交于 2019-12-03 01:46:01

问题:

I am developing an app that initially displays a table. You tap a cell in the table and the cell expands, showing a table view inside the cell. To do this I implemented the UITableView delegate inside the custom UITableViewCell. I would like to now have a selection on a cell in the second table view to expand the cell and show another table (two levels drop). Is this possible? Would I just create a table on selection (didSelectRowAtIndexPath in the custom cell class)? Where would I put the table methods for it?

回答1:

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled. source

As UITableViews subclasses UIScrollViews this applies here too.

What you want can be achieved by using section header views for the coffee displaying view and custom cells for the options.
Or using custom cells for he coffee views and section footer views for the options.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!