如果你使用了MJRefresh进行刷新,并且你隐藏了导航栏,就会出现下拉刷新错乱的问题。
因为iOS 11上废除了automaticallyAdjustsScrollViewInsets这个方法,使用UIScrollView's contentInsetAdjustmentBehavior来代替,解决办法就是一段代码:
OC:
if (@available(iOS 11.0, *)) {
self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
swift:
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
} else {
self.automaticallyAdjustsScrollViewInsets = false
}