判斷tableview滾動(dòng)到最后一行cell方法:
-?(void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (self.statuses.count == 0) {
return;
}
// 1.差距
CGFloat delta =scrollView.contentSize.height - scrollView.contentOffset.y;
//剛好能完整看到footer的高度
CGFloat sawFooterH = scrollView.height -self.tabBarController.tabBar.height;
// 2.如果能看見(jiàn)整個(gè)footer
if (delta <= (sawFooterH - 0)) {
//顯示footer
self.tableView.tableFooterView.hidden =NO;
//加載更多狀態(tài)
[self loadMoreStatus];
}
}