iphone - 在以编程方式移动的 ScrollView 中检测到 "end decelerating"

标签 iphone ios xcode uiscrollview scroll

我有一个手动拖动的 ScrollView ,现在我希望通过以下代码在单击按钮时以编程方式移动 ScrollView :

offset = CGPointMake(scrollView.contentOffset.x+320, 0);

[UIScrollView beginAnimations:@"scrollAnimation" context:nil];
[UIScrollView setAnimationDuration:0.5];
[scrollView1 setContentOffset:offset];
[UIScrollView commitAnimations];

它运行良好,但现在未调用函数 scrollViewBeginDragging 和 scrollViewEndDecelerating。 Begindragging 对我来说没问题,但我不知道如何检测以编程方式触发 ScrollView 移动的结束。

提前致谢!

最佳答案

实现 scrollViewDidEndScrollingAnimation: 委托(delegate)方法。这正是它的用途。

关于iphone - 在以编程方式移动的 ScrollView 中检测到 "end decelerating",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14129034/

相关文章:

ios - iOS 6 Beta 3 (ipad 3) 中的 UIAlertView 似乎没有触发委托(delegate)中的代码

android - 使用 React Native 创建原生 SDK

ios - 通过 cocoapods 在 swift 项目(iOS 8.0 目标)中添加 Facebook Pop 是不可能的

iphone - 检查应用程序更新是否有效,无需提交到 App Store

ios - 在 Xamarin iOS 13 中自定义导航栏不起作用

objective-c - 使应用程序的更新版本与其以前的版本兼容

iphone - 阵列清理方法错误

iphone - 在 iOS 上,如何使 cell.imageView 刷新其内容?

iphone - 我该如何限制 ipad 中的文件应用程序大小?

iphone - 如何以编程方式刷新 UIViewController?