Expandable TableView [closed]

元气小坏坏 提交于 2019-11-30 21:02:17

问题


How to show table view in categories and when clicked on one row it will expand with content? I've seen it in some apps and that's how I know it is possible but can't find any reference or tutorial regarding it.

I would appreciate if someone could help me even if I don't have example code, because I don't know how to start with it.


回答1:


I think this should be done by means of table view. I personally did this the following way: at first there was a table view with 5 sections and every section had no rows in it, only a header. When the header is clicked the sections "expands" - I add the rows to the section (insertRowsAtIndexPaths). If the section header is clicked again, I delete the rows from datasourse (deleteRowsAtIndexPaths). Hope this is useful




回答2:


Go through this sample code

https://github.com/adamhoracek/KOTree

The table view will look like this



来源:https://stackoverflow.com/questions/8657502/expandable-tableview

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