7

我在示例中似乎只能找到使用变换或正在修改框架。我错过了什么明显的东西吗?目前其他动画(淡入淡出)都工作正常,但是约束保持锁定在位置。

一个快速的代码片段:

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

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

} completion:^(BOOL finished) {
    [transitionContext completeTransition:YES];
}];
4

1 回答 1

0

您需要layoutIfNeeded致电[[customViewController view] superview]

于 2014-10-15T13:06:34.417 回答