Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView: how to detect when scrolling has stopped

I'm using a UICollectionView to scroll through a set of thumbnails quickly. Once scrolling ends, I'd like to display a larger hi-res version of the current thumbnail.

How can I detect when the user has completed scrolling? I do implement didEndDisplayingCell, but that only tells me when a particular cell has scrolled off; it doesn't tell me when the scroll motion actually completes.

like image 307
George Armhold Avatar asked Feb 14 '13 05:02

George Armhold


People also ask

How can I tell when a UIScrollView has finished scrolling?

scrollViewDidScroll only notifies you that the scroll view did scroll not that it has finished scrolling. The other method scrollViewDidEndScrollingAnimation only seems to fire if you programmatically move the scroll view not if the user scrolls.

How do I find scrolling collection view?

So if you have set the delegate and implemented UIScrollViewDelegate , you should be able to detect this the same way as UIScrollView . - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; As per documentation, the above method should tell when the scroll view has ended decelerating the scrolling movement.

How do I stop auto scrolling of Uicollectionview by voiceover?

UIScrollViewDelegate. scrollViewDidScroll(_:) A change in the accessibility focus that triggers an automatic scrolling also triggers a call to scrollViewDidScroll(_:) in your UIScrollViewDelegate. Use that to counter the automatic scrolling effect, f.i. by setting contentOffset the way you prefer it.

What is swift Uicollectionview?

An object that manages an ordered collection of data items and presents them using customizable layouts.


1 Answers

NS_CLASS_AVAILABLE_IOS(6_0) @interface UICollectionView : UIScrollView 

UICollectionView is a subclass of UIScrollView. So if you have set the delegate and implemented UIScrollViewDelegate, you should be able to detect this the same way as UIScrollView.

For eg:-

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; 

As per documentation, the above method should tell when the scroll view has ended decelerating the scrolling movement.

like image 52
iDev Avatar answered Sep 21 '22 05:09

iDev