动画 AutoLayout 约束中断 iOS 9
Animating AutoLayout constrains breaks in iOS 9
所以我刚刚 xCode 升级到版本 7.0 (7A220) 并且它破坏了一些动画,我不确定这里有什么问题。
[UIView animateWithDuration:SLIDE_UP_DURATION animations:^{
self.cubeIconWhiteYAlignmentToContainerView.constant = actualOffset;
[self.cubeNoIconWhiteImageView layoutIfNeeded];
[self.cubeIconWhiteImmageView layoutIfNeeded];
self.buttonConstraintToBottom.constant = FINAL_BUTTON_HEIGHT;
[self.logInButton layoutIfNeeded];
[self.registerButton layoutIfNeeded];
} completion:^(BOOL finished) {
if (finished) {
[self fadeIn];
}
}];
按钮可以很好地向上滑动,但图像视图会捕捉到它们的最终高度。我想念的是这只是苹果方面的一个错误吗?
显然,约束接触的两个视图都需要调用 layoutIfNeeded。
所以我刚刚 xCode 升级到版本 7.0 (7A220) 并且它破坏了一些动画,我不确定这里有什么问题。
[UIView animateWithDuration:SLIDE_UP_DURATION animations:^{
self.cubeIconWhiteYAlignmentToContainerView.constant = actualOffset;
[self.cubeNoIconWhiteImageView layoutIfNeeded];
[self.cubeIconWhiteImmageView layoutIfNeeded];
self.buttonConstraintToBottom.constant = FINAL_BUTTON_HEIGHT;
[self.logInButton layoutIfNeeded];
[self.registerButton layoutIfNeeded];
} completion:^(BOOL finished) {
if (finished) {
[self fadeIn];
}
}];
按钮可以很好地向上滑动,但图像视图会捕捉到它们的最终高度。我想念的是这只是苹果方面的一个错误吗?
显然,约束接触的两个视图都需要调用 layoutIfNeeded。