蘋(píng)果iOS11新協(xié)議:MJRefresh在iOS11.0中稍微上拉觸發(fā)瞬間刷新事件甚淡,自iOS11.0和iPhone X發(fā)布以來(lái)iOSDeveloper都要學(xué)習(xí)蘋(píng)果爸爸給的新協(xié)議,MJRefresh在iOS11.0中也不能幸免掠手,手勢(shì)觸摸屏幕胎撇,稍微下拉就會(huì)觸發(fā)下拉刷新事件,還有就是我的TableView分區(qū)頭會(huì)自動(dòng)的亂跑秉犹。
@property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets API_DEPRECATED_WITH_REPLACEMENT("Use UIScrollView's contentInsetAdjustmentBehavior instead", ios(7.0,11.0),tvos(7.0,11.0)); // Defaults to YES
iOS11.0也棄用了automaticallyAdjustsScrollViewInsets蛉谜。
解決方案:
if(@available(iOS 11.0, *)) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;?
} else{self.automaticallyAdjustsScrollViewInsets = NO;}
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 49, 0); self.tableView.scrollIndicatorInsets = self.tableView.contentInset;