Animating autolayout constraint changes for subviews
Animating autolayout constraint changes for subviews
- Subject: Animating autolayout constraint changes for subviews
- From: Doug Hill <email@hidden>
- Date: Wed, 28 Dec 2016 11:55:37 -0800
I had a previous question to the list about animating autolayout constraint changes at runtime. The documentation on this is a little thin and was grateful for the list's suggestions on the correct way to do this.
I can now animate my constraint changes but I notice that subviews aren't animated. For example, I have a single view with a width constraint, and this view has a label as a subview that expands to the size of it's parent view via edge constraints.
I can change the width constraint constant of the parent view at runtime and it animates very well. However, the subviews jump into place immediately then the parent view animates into place. I see the same behavior with a button as a subview.
Doing a Google search I see examples of other people running into this same problem but don't find a good solution. For example, I see people animating the subview themselves via a timer.
http://stackoverflow.com/questions/20097580/autolayout-animate-constraint-does-not-animate-subviews#32891810
This doesn't look like a very good solution to me since it would be almost impossible to match that same animation of the parent view.
Before I go too much further, I'm looking to see if there are better solutions out there, other other pointers to documentation about this.
Thanks.
Doug Hill
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden