twitter/twui — Issue #85: TUIScrollView animation
Author: mrjjwright
Created: 2011-12-04 15:40:35+00:00
State: open

I am trying to create a resize toggle on this custom TUIScrollView class that I have built. The user clicks a button and all rows shrinks smoothly to a size where the user can reorder some rows, delete some rows, etc... and then the user toggles the view back out to it's size. I am not using TUITableView but have built my own subclass that is similar to it, it also recycles views on and off screen. I built my own subclass so I can handle a number of animations I need to do on this class more tightly.

While doing this resize I first resize all the rows, recalculate and set the contentSize on the TUIScrollView, cycle in all the new views (say 10 more views will fit in the shrunk view so dequeueReusableView and addSubview gets called 10 times) and finally I animate the frames of all the views to the right size.

The problem is that all the newly added subviews lag behind the views that were on the screen and I can't figure out why the animation isn't all happening together. I am wondering if it has to with how a CAScrollLayer works or if somebody can help me think through this. I won't leave this up for long if nobody is interesed as I know there is no core issue here with TUI.

Thanks!

John