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

查看:30
本文介绍了如何知道 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天全站免登陆