views:

104

answers:

2

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?

+3  A: 
tc.
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
+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
Oh... If that's the case, then I misread what you were saying. Try `view.frame = blah; [view layoutIfNeeded]`
tc.
no, that will just move them into position, and then animate the bounds. It's what I tried initially.
Ben Gottlieb