使用MJRefresh 上拉加載的時候若是沒有更多數據, 數據刷新Tableview 而後 [self.tableView.mj_footer endRefreshing] 頭部留空現象. tableview已向下偏移 下拉動畫已隱約出現一小部分 下拉刷新動畫 出現異常 以前版本並未出現這種問題。 查閱發現 iOS11棄用了automaticallyAdjustsScrollViewInsets屬性,新增contentInsetAdjustmentBehavior來替代它 UIScrollViewContentInsetAdjustmentBehavior 是一個枚舉類型,值有如下幾種: -automatic 和scrollableAxes同樣,scrollView會自動計算和適應頂部和底部的內邊距而且在scrollView 不可滾動時,也會設置內邊距. -scrollableAxes 自動計算內邊距. -never不計算內邊距 -always 根據safeAreaInsets 計算內邊距 方法一: if (@available(iOS 11.0, *)) { _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } 方法二: if (@available(iOS 11.0, *)) { self.tableView.estimatedRowHeight =0; self.tableView.estimatedSectionHeaderHeight =0; self.tableView.estimatedSectionFooterHeight =0; } 方法三:注意⚠️:這種問題未使用上面解決辦法而使用如下這種方法,只能解決留白問題,反而致使上拉刷新回彈問題動畫