添加定时器两秒调用一次reloadSections:方法;
发生下面情况:刷新时 tableview 会跳动一下
尝试过的方法:
// 1
[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
[self.tableView endUpdates];
// 2
[UIView performWithoutAnimation:^{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
}];
// 3
[self.tableView performBatchUpdates:^{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
} completion:^(BOOL finished) {}];
// 4
[self.tableView beginUpdates];
[self.tableView performBatchUpdates:^{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
} completion:^(BOOL finished) {}];
[self.tableView endUpdates];
均没效果
iOS11默认开启Self-Sizing 如果你没用到预估高度 那么你尝试在Appdelegate.m中的
didFinishLaunchingWithOptions
方法中,加上如下代码,看看是否有效建议去看看适配iOS11的相关内容