iOS11默认开启Self-Sizing 如果你没用到预估高度 那么你尝试在Appdelegate.m中的didFinishLaunchingWithOptions
方法中,加上如下代码,看看是否有效
if (@available(iOS 11.0, *)) { UITableView.appearance.estimatedRowHeight = 0; UITableView.appearance.estimatedSectionFooterHeight = 0; UITableView.appearance.estimatedSectionHeaderHeight = 0; }