原因 UITableView 的 Self-Sizing。及自动计算属性
在iOS11之前Self-Sizing默认是关闭的而在之后默认使用Self-Sizing.
为了性能,使用estimated而不是准确的的值来确定contentsize。因此在estimatedRowHeight, estimatedSectionHeaderHeight,estimatedSectionFooterHeight由0变为了UITableViewAutomaticDimension高度后,contentSize 出现了偏差。
解决方案 设置 estimatedRowHeight, estimatedSectionHeaderHeight, estimatedSectionFooterHeight 为0.
使用Runtime全局替换方案: