UITableView的区头跟着滑动有可能会造成滑动到头部的时候回卡顿,如果你写了这样一段话,那么,很有可能是它造成的
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
if (scrollView == self.tableView) {
[[NSNotificationCenter defaultCenter] postNotificationName:kBackScroll object:self userInfo:@{@"noticification":@(scrollView.contentOffset.y)}];
CGFloat contentHeight = kRadio(260);
if (scrollView.contentOffset.y <= contentHeight && scrollView.contentOffset.y > 0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
}else if(scrollView.contentOffset.y >= contentHeight){
scrollView.contentInset = UIEdgeInsetsMake(-contentHeight, 0, 0, 0);
}
}
}
解决方法: 将tableView的样式改为Grouded的,不再使用scrollView的滑动判断