We have implemented a horizontal scroller with UICollectionView
by customizing the collection flow layout dimensions.
We wanted to show left pagination indicator and right pagination indicator to tell that there are more cells to the left and/or right.
To accomplish this, we have written the below piece of code in the method;
-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
but it is not working properly. The max no of cells that can be shown are 5 (i.e. page size is 5).
if(_people.count > 5 && indexPath.row > 4) {
// SHOW THE LEFT INDICATOR
NSLog(@"images at left");
}
NSLog(@" %ld %lu", indexPath.row, _people.count);
if(_people.count > 5 && indexPath.row < _people.count-1) {
// SHOW THE RIGHT INDICATOR
NSLog(@"images at right");
}
This solution is working properly when we scroll slowly, but not working when we scroll very fast. Please suggest how we can accomplish this.