iphone 如何判断tableview滚动到最低端


 原文摘自:http://www.cocoachina.com/bbs/read.php?tid-66690.html

 

1.用- (void)scrollViewDidScroll:(UIScrollView *)scrollView 这个是UIScrollViewDelegate方法,UITableViewDelegate继承它。它可以追踪你的UITableView在滑动过程中的变化。
2.思路是用UIScrollView的属性contentSize,frame和contentOffset值来判断。
3.具体代码是这样的:
CGPoint contentOffsetPoint = tableView.contentOffset;
CGRect frame = listTableView.frame;
if (contentOffsetPoint.y == listTableView.contentSize.height - frame.size.height || listTableView.contentSize.height < frame.size.height) 
{
    NSLog(@"scroll to the end");
}

posted on 2012-03-15 16:02  wtq  阅读(5011)  评论(1编辑  收藏  举报