ios - UIDynamics and Autolayout -


recently used uidynamics animate image view place. however, because autolayout y-pos constraint set off-screen, when navigating away screen , returning it, image view being placed off-screen again. animation took 3 seconds, after 3 seconds reset constraint. feels little hacky.

so question this: proper way handle autolayout , uidynamics @ same time?

this not dynamics problem. autolayout incompatible any view animation, or any manual setting of frame: when layout comes along, constraints obeyed. you, if move view manually in any way, update constraints match new position/size/whatever.

having said that: uikit dynamics, when animation ends, animator pause, , animator's delegate notified:

https://developer.apple.com/library/ios/documentation/uikit/reference/uidynamicanimatordelegate_protocol/reference/reference.html#//apple_ref/occ/intfm/uidynamicanimatordelegate/dynamicanimatordidpause:

so moment update constraints.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -