原因: iOS11弃用了automaticallyAdjustsScrollViewInsets属性,新增contentInsetAdjustmentBehavior来替代它
//解决方案 在viewDidLoad 添加如下代码
if (@available(iOS 11.0, *)) {
//ios 11以上
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
//ios 11以下
self.automaticallyAdjustsScrollViewInsets=NO;
}
原文:https://www.cnblogs.com/soulDn/p/10233993.html