Animate contentOffset when contentSize become smaller the frame size in
UICollectionView
I have UICollectionView with 2 sections. Each section is 75% height of
screen frame height. The screen is scrolled to the bottom, so I see 25% of
the first section and 100% of second one.
Then I reload the second section and its height becomes only 10% of the
frame height (so I can see them both on the screen) - the screen jumps to
the top.
As contentSize becomes smaller than the frame, it set contentOffset to 0,
so the screen jumps to the top.
I want to "animate" the jump, so the screen scrolled to the top. Probably,
I need to setContentOffset:Animated when the contentSize becomes smaller
then the screen frame.
Any idea where I can do it to properly animate it?
PS. I've tried sticking observer to contentSize and
setContentOffset:Animated over there, but it doesn't do anything.
No comments:
Post a Comment