导航

uitableView 滚到底部判断

Posted on 2014-08-05 14:59  0304  阅读(393)  评论(0编辑  收藏  举报
- (void) scrollViewDidScroll:(UIScrollView *)scrollView { CGPoint offset = scrollView.contentOffset; // 当前滚动位移 CGRect bounds = scrollView.bounds; // UIScrollView 可视高度 CGSize size = scrollView.contentSize; // 滚动区域 UIEdgeInsets inset = scrollView.contentInset; float y = offset.y + bounds.size.height - inset.bottom; float h = size.height; NSLog(@"offset: %f", offset.y); NSLog(@"content.height: %f", size.height); NSLog(@"bounds.height: %f", bounds.size.height); NSLog(@"inset.top: %f", inset.top); NSLog(@"inset.bottom: %f", inset.bottom); NSLog(@"pos: %f of %f", y, h); float reload_distance = 10; if (y > (h + reload_distance)) { // 滚动到底部 // ... } } http://laiguowei2004.blog.163.com/blog/static/3682900020128252478488/