当UITableView完成滚动时,是否可以通知? [英] Is it possible to be notified when a UITableView finishes scrolling?

查看:167
本文介绍了当UITableView完成滚动时,是否可以通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我引用了此问题:如何检测UIScrollView已完成滚动



UITablewView是UIScrollView的子类,我的UITableView委托获得



但是,当我调用<$ c $($)时,会弹出一个(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView c> - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated 滚动表,我没有得到 scrollViewDidEndDecelerating 消息。我使用 animated:YES 调用 scrollRowToIndexPath ... 方法。

这是一个错误/ API限制(在iPhone SDK 3.1.3上),或者我缺少另一种方法来做这个?

解决方案

为了防止有人继续追踪这个文件,Apple文档在 scrollToRowAtIndexPath:atScrollPosition:animated:文档中说:


调用此方法不会导致委托接收
scrollViewDidScroll:消息,正如
程序调用的用户界面操作。



I referenced this question: How to detect when a UIScrollView has finished scrolling

UITablewView is a subclass of UIScrollView, and my UITableView delegate does get the - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView message when I scroll the table by hand.

However, when I call - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated to scroll the table, I don't get the scrollViewDidEndDecelerating message. I am calling the scrollRowToIndexPath... method with animated:YES.

Is this a bug/API limitation (on iPhone SDK 3.1.3) or am I missing another way to do this?

解决方案

Just in case someone is still chasing this one, the Apple docs say the following under the scrollToRowAtIndexPath:atScrollPosition:animated: documentation:

"Invoking this method does not cause the delegate to receive a scrollViewDidScroll: message, as is normal for programmatically-invoked user interface operations."

这篇关于当UITableView完成滚动时,是否可以通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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