I have a UIView with a bunch of subviews, all positioned using -layoutSubviews. When the view is resized, the relative positions all change. I'd like these re-calculations to happen during an animated resize (using +[UIView beginAnimations:] calls). This doesn't seem to be happening. Any ideas?
Thanks for the detailed look under the covers. While I was peripherally aware of the tree hierarchy, you put together a great synthesis of why Core Animation's architecture basically doesn't allow what I want to do.
Ben Gottlieb
2010-09-12 13:36:53
+1
A:
Posting for completeness. Thanks to tc. for explaining that what I want to do, exactly, is not supported by Core Animation.
I eventually came up with a reasonable solution. Rather then layout my subviews in -layoutSubviews, I do so in -setBounds:. Then, when I wrap a -setBounds: call in a UIView +beginAnimations: block, those positioning calls are also animated, and the end result is everything properly animating to where it should god.
Ben Gottlieb
2010-09-12 13:39:13
Oh... If that's the case, then I misread what you were saying. Try `view.frame = blah; [view layoutIfNeeded]`
tc.
2010-09-13 00:37:36
no, that will just move them into position, and then animate the bounds. It's what I tried initially.
Ben Gottlieb
2010-09-13 01:08:58