MJRefresh在iOS11中第一行cell被遮住
2017-09-05 本文已影响29人
csp
在iOS11中,swift项目中使用MJRefresh,第一行cell会有一点显示不出来。
是因为iOS11中automaticallyAdjustsScrollViewInsets被弃用了,要使用contentInsetAdjustmentBehavior来代替。
修改:
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
tableView.contentInset = UIEdgeInsetsMake(64, 0, 49, 0)
tableView.scrollIndicatorInsets = tableView.contentInset
}