在Appdelegate.m中的didFinishLaunchingWithOptions 方法中添加如下代码,就全局搞定了!
if (@available(ios 11.0,*))
{
UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
UITableView.appearance.estimatedRowHeight = 0;
UITableView.appearance.estimatedSectionFooterHeight = 0;
UITableView.appearance.estimatedSectionHeaderHeight = 0;
[UITableView appearance].contentInsetAdjustmentBehavior = UIScreenOverscanCompensationNone;
}