Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 无动画以编程方式删除UITableCell_Iphone_Objective C_Uitableview - Fatal编程技术网

Iphone 无动画以编程方式删除UITableCell

Iphone 无动画以编程方式删除UITableCell,iphone,objective-c,uitableview,Iphone,Objective C,Uitableview,当我以编程方式删除一组单元格(我通常位于tableview的底部)时,所有单元格都会移动(因为被删除的单元格是从顶部移动的)。当我删除行时,如何停止这种移动/抖动/重新排列?在添加和删除行时使用reloadData,它只会捕捉。在添加和删除行时使用reloadData,它只会捕捉。在调用deleteRowsAtIndexPaths之前,保存当前可见行的indexPath。请参阅有关如何执行此操作的信息 保存indexPath后,删除行后,调用: 在调用DeleteRowsatindExpath之

当我以编程方式删除一组单元格(我通常位于tableview的底部)时,所有单元格都会移动(因为被删除的单元格是从顶部移动的)。当我删除行时,如何停止这种移动/抖动/重新排列?

在添加和删除行时使用
reloadData
,它只会捕捉。

在添加和删除行时使用
reloadData
,它只会捕捉。

在调用deleteRowsAtIndexPaths之前,保存当前可见行的indexPath。请参阅有关如何执行此操作的信息

保存indexPath后,删除行后,调用:


在调用DeleteRowsatindExpath之前,请保存当前可见行的indexPath。请参阅有关如何执行此操作的信息

保存indexPath后,删除行后,调用:


我想这就是你想要的方法(?):


我想这就是你想要的方法(?):


你是什么意思?更改数据源而不执行deleteRowsAtIndexPaths业务?对。更改数据源,然后
[tableView reloadData]
。哇,甜蜜的愿望2周前我问过这个问题。你是什么意思?更改数据源而不执行deleteRowsAtIndexPaths业务?对。更改数据源,然后
[tableView reloadData]
。哇,甜蜜的愿望2周前我问过这个问题。
[tableview scrollToRowAtIndexPath:savedIndexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
[tableView deleteRowsAtIndexPaths: indexPath withRowAnimation: UITableViewRowAnimationNone];