可扩展的表格视图

发布于 2024-12-23 07:27:53 字数 124 浏览 6 评论 0原文

如何按类别显示表格视图,并且单击一行时它将随内容展开? 我在一些应用程序中看到过它,这就是我知道它是可能的,但找不到任何有关它的参考或教程。

即使我没有示例代码,如果有人可以帮助我,我将不胜感激,因为我不知道如何开始。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖阳 2024-12-30 07:27:53

我认为这应该通过表视图来完成。我个人是按照以下方式执行此操作的:首先有一个包含 5 个部分的表视图,每个部分中没有行,只有一个标题。单击标题时,各部分“展开” - 我将行添加到该部分(insertRowsAtIndexPaths)。如果再次单击节标题,我将从数据源中删除行 (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

却一份温柔 2024-12-30 07:27:53

浏览此示例代码

https://github.com/adamhoracek/KOTree

表格视图将如下所示这个

https://i.sstatic.net/mdnAl.png

Go through this sample code

https://github.com/adamhoracek/KOTree

The table view will look like this

https://i.sstatic.net/mdnAl.png

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文