gpt4 book ai didi

ios - 如何在运行时增加 UITableview 中的行数?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:43:22 27 4
gpt4 key购买 nike

我想知道是否有什么方法可以在不调用 reload 的情况下增加 UITableview 的行数?我不想重新加载整个表只是在运行时添加新行。我知道如何插入新行和更新,但只有在 UITableView 对象上调用重新加载后行数才会增加,有出路吗?

最佳答案

尝试做这样的事情:

NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:0 inSection:1];    
//put these indexpaths in a NSArray

[tableView insertRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone];

关于ios - 如何在运行时增加 UITableview 中的行数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14395012/

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