I have a UIScrollView that is displaying a list of data.
Right now, when the user adds one more item to the list, I can extend the content size of the UIScrollView and scroll down smoothly using setContentOffset and YES to animated.
When the user removes an item from the list, I want to resize the content size of the UIScrollView, and scroll back up one step also in an animated fashion.
How can I get the ordering right? Right now, if I resize the content size before scrolling back up, the scroll isn’t animated.
I tried scrolling back up before resizing the content size, but that still didn’t give a smooth transition.
Is there a way to finish the scrolling animation BEFORE resizing the content size?
Thanks
Yes, you need to call the method to resize your content after the scroll view’s animation is complete. You can do that in the scroll view delegate’s
scrollViewDidEndScrollingAnimation:method. Set your controller as the delegate, and implement that method.You don’t need a timer or a table view for this.