(iphone)强制scrollViewDidEndDecelerating在以编程方式滚动视图后调用? [英] (iphone) force scrollViewDidEndDecelerating to be called after programmatically scrolling a view?

查看:149
本文介绍了(iphone)强制scrollViewDidEndDecelerating在以编程方式滚动视图后调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用为滚动设置动画scrollRectToVisible:animated:

但是 scrollViewDidEndDecelerating 没有被调用。

有没有办法强制调用函数?

Is there a way to force the function to be called?

推荐答案

<不会为<$​​ c $ c> scrollRectToVisible 或 setContentOffset c $ c> scrollViewDidEndDecelerating >(即以编程方式滚动)。如果您在头文件中注意到此方法的声明,它会清楚地提到它在我们移动时被调用。

scrollViewDidEndDecelerating won't be called for scrollRectToVisible or setContentOffset (i.e, scrolling programmatically). If you notice the declaration of this method in the header file it clearly mentions that it's "called on finger up as we are moving".

现在,为了解决您的问题,将调用 scrollViewDidEndScrollingAnimation 委托(对于 setContentOffset scrollRectToVisible ) ,你可以使用。

Now, to address your issue, scrollViewDidEndScrollingAnimation delegate will be called (for setContentOffset and scrollRectToVisible), which you can use.

这篇关于(iphone)强制scrollViewDidEndDecelerating在以编程方式滚动视图后调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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