如何知道UITableView何时在iPhone中滚动到底部 [英] How to know when UITableView did scroll to bottom in iPhone

查看:112
本文介绍了如何知道UITableView何时在iPhone中滚动到底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道什么时候 UITableView 滚动到底部才能加载并显示更多内容,比如代理或其他东西让控制器知道何时桌子确实滚动到了底部。

I would like to know when a UITableView did scroll to bottom in order to load and show more content, something like a delegate or something else to let the controller know when the table did scroll to bottom.

有谁知道这个,请帮助我,提前谢谢!

Does anyone know this, please help me, thanks in advance!

推荐答案

最好的方法是测试屏幕底部的一个点,并在用户滚动时使用此方法调用( scrollViewDidScroll ):

The best way is to test a point at the bottom of the screen and use this method call when ever the user scrolls (scrollViewDidScroll):

- (NSIndexPath *)indexPathForRowAtPoint:(CGPoint)point

测试屏幕底部附近的一个点,然后使用indexPath返回检查是否存在indexPath是最后一行,如果是,则添加行。

Test a point near the bottom of the screen, and then using the indexPath it returns check if that indexPath is the last row then if it is, add rows.

这篇关于如何知道UITableView何时在iPhone中滚动到底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆