UIScroll View Delegate not calling ScrollViewDidEndScrollingAnimation

安稳与你 提交于 2019-11-27 13:29:13

问题


I have implemented the UIScrollViewDelegate protocol in my .h file and i have implemented the

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView

method in my .m class. when the scrolling is done in my table view other delegate method of scrollview are getting called, but when scrolling ends, -scrollViewDidEndScrollingAnimation: is not getting called. I am bit stuck in this.

Thanks and regards


回答1:


-scrollViewDidEndScrollingAnimation: is called when a programmatic-generated scroll finishes.
-scrollViewDidEndDecelerating: is called when a user-swipe scroll finishes.




回答2:


I had the same problem ... Try using scrollViewDidEndDecelerating instead.




回答3:


Had the same problem. Have used the following in my delegate class:

#pragma mark -
#pragma mark UIScrollViewDelegate
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {

    NSLog(@"lol");
}

works like a charm!




回答4:


I had the same problem and the issue was i did not include the delegate code:

self.myScrollView.delegate=self;

Hope this helps someone as well.




回答5:


Swift?

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {

}


来源:https://stackoverflow.com/questions/1969256/uiscroll-view-delegate-not-calling-scrollviewdidendscrollinganimation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!