gpt4 book ai didi

iphone - 在 ios 中点击节标题时,在节中折叠展开行

转载 作者:行者123 更新时间:2023-12-01 16:51:15 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Expand/collapse section in UITableView in iOS

(17 个回答)


8年前关闭。




我的应用程序中有一个分段 TableView ,但我想在点击此部分时折叠/展开部分中的行。

我想知道如何实现的步骤。

数据是从 JSON 文件作为字典导入的,我有 Storyboard界面构建器。

当点击此部分时,我想显示/隐藏特定部分的行。

我在等待你的回答。

最佳答案

您可以为此使用这些代码行。

添加行

        NSIndexPath *tmpIndexpath=[NSIndexPath indexPathForRow:0 inSection:Sender.tag];
[tbl_Qus insertRowsAtIndexPaths:[NSArray arrayWithObjects:tmpIndexpath, nil] withRowAnimation:UITableViewRowAnimationFade];

删除行
        NSIndexPath *tmpIndexpath=[NSIndexPath indexPathForRow:0 inSection:Sender.tag];
[tbl_Qus deleteRowsAtIndexPaths:[NSArray arrayWithObjects:tmpIndexpath, nil] withRowAnimation:UITableViewRowAnimationFade];

您也可以从此 link 下载教程.

关于iphone - 在 ios 中点击节标题时,在节中折叠展开行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15675771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com