可扩展的TableView [英] Expandable TableView
问题描述
如何在类别中显示表格视图,当点击一行时,它会随内容展开?
我在一些应用程序中看过它,这就是我知道它是可能的但是找不到任何关于它的参考或教程。
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.
推荐答案
<我认为这应该通过表格视图来完成。我个人通过以下方式做到了这一点:起初有一个包含5个部分的表视图,每个部分都没有行,只有一个标题。单击标题时,扩展部分 - 我将行添加到部分(insertRowsAtIndexPaths)。如果再次单击节标题,我将从datasourse删除行(deleteRowsAtIndexPaths)。希望这很有用
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
这篇关于可扩展的TableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!