Ios 重新加载UITableView节时,所有节都会闪烁

Ios 重新加载UITableView节时,所有节都会闪烁,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我使用的是UITableViewController,我使用的是: [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:sectionNumber] withRowAnimation:UITableViewRowAnimationNone]; 重新加载tableview的单个部分(为插入新单元格设置动画)。问题是,每次打电话时,所有部分及其单元格都会短暂闪烁白色。如果我使用 [self.tableview reloadDat

我使用的是
UITableViewController
,我使用的是:

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:sectionNumber] withRowAnimation:UITableViewRowAnimationNone];
重新加载tableview的单个部分(为插入新单元格设置动画)。问题是,每次打电话时,所有部分及其单元格都会短暂闪烁白色。如果我使用

[self.tableview reloadData];
但无论我使用哪一行动画,都会发生


我知道我可以使用
insertRowsAtIndexPaths:withrowsanimation:
,但我目前有一个不允许我使用的竞争条件。我会在某个时候解决这个问题,但在此期间,我想知道为什么在我重新加载单个部分时,所有部分的单元格都会闪烁。此外,如果我可以关闭闪光灯,只需设置单元格插入/删除的动画,那将是理想的。

我相信它会闪烁,因为当您重新加载特定部分时,它仍然需要重新计算所有可见部分的大小。因此闪光。如果不使用插入/删除(因为它知道表将只更改一次),您将无法通过该操作


但是,如果您只是在模拟器中尝试此操作,那么当加载到实际设备上时,闪存可能会消失或不太明显。

可能太晚了。但它可以帮助别人

Obj-c:

[UIView performWithoutAnimation:^{
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
}];
    UIView.performWithoutAnimation {
        self.tableView.reloadSections(NSIndexSet(index: indexPath.section), with: .none)
    }
Swift 5:

[UIView performWithoutAnimation:^{
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
}];
    UIView.performWithoutAnimation {
        self.tableView.reloadSections(NSIndexSet(index: indexPath.section), with: .none)
    }

你能提供一些代码示例吗?