0

I'm using a infinitive scrolling feature similar to this. Now my problem is that I want to set a target content offset after a reload has taken place.

Currently I'm using the targetContentOffsetForProposedContentOffset of the UICollectionViewLayout for setting the stopping position of the UICollectionView. But that doesn't work correctly. The target content offset is calculated before the reload, then the reload takes place, and the scroll view scrolls further. Therefore the target content offset is wrong. Perhaps one can force the scroll view stop scrolling so that I can freely set the content offset?

How do you set the target content offset when a reload of the UICollectionView takes place?

Community
  • 1
  • 1
testing
  • 17,950
  • 38
  • 208
  • 373

1 Answers1

0

Don't know why but in backwards direction the scroll view scrolls further despite the target content offset should limit it. Now I don't use an animation in backwards direction, which should act like a scrolling lock:

CollectionView.SetContentOffset(newContentOffset, false);

But in forwards direction I have to use this:

CollectionView.ContentOffset = newContentOffset;

No idea why I have to do this in this way, but now it seems to work.

testing
  • 17,950
  • 38
  • 208
  • 373