原因 UITableView 的 Self-Sizing。及自動計算屬性
在iOS11之前Self-Sizing默認是關閉的而在之后默認使用Self-Sizing.
為了性能,使用estimated而不是准確的的值來確定contentsize。因此在estimatedRowHeight, estimatedSectionHeaderHeight,estimatedSectionFooterHeight由0變為了UITableViewAutomaticDimension高度后,contentSize 出現了偏差。
解決方案 設置 estimatedRowHeight, estimatedSectionHeaderHeight, estimatedSectionFooterHeight 為0.
使用Runtime全局替換方案: