سؤال

All I can seem to find in examples are using transforms or are modifying frames. Have I missed something obvious? Currently the other animations (fades) are all working fine, however the constraint stays locked in position.

A quick code snippet:

[[customViewController view] layoutIfNeeded];
[UIView animateWithDuration:2 animations:^{

    [[customViewController constraintToAnimate] setConstant:1024];
    [[customViewController view] layoutIfNeeded];

} completion:^(BOOL finished) {
    [transitionContext completeTransition:YES];
}];
هل كانت مفيدة؟

المحلول

You need to call layoutIfNeeded on the [[customViewController view] superview]

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top