我在示例中看起来似乎都在使用变换或正在修改帧。我错过了明显的东西吗?目前其他动画(淡入淡出)都工作正常,但约束仍然锁定在位。
快速代码段:
[[customViewController view] layoutIfNeeded];
[UIView animateWithDuration:2 animations:^{
[[customViewController constraintToAnimate] setConstant:1024];
[[customViewController view] layoutIfNeeded];
} completion:^(BOOL finished) {
[transitionContext completeTransition:YES];
}];
答案 0 :(得分:0)
您需要致电layoutIfNeeded
[[customViewController view] superview]