參考:https://www.jianshu.com/p/5f033fdd4ddb
一般情況下
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
可以解決
但是如果有切換不同類型cell的需求,還是會跳動
需要將簡單的reloadData替換為
[UIView performWithoutAnimation:^{ [self reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; }]; [UIView performWithoutAnimation:^{ [self reloadData]; }];