【问题标题】:Animating AutoLayout constrains breaks in iOS 9动画 AutoLayout 约束 iOS 9 中的中断
【发布时间】:2015-12-16 05:55:15
【问题描述】:

所以我刚刚将 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];
    }
}];

按钮可以很好地向上滑动,但图像视图会捕捉到它们的最终高度。我缺少的是这只是苹果方面的一个错误吗?

【问题讨论】:

    标签: objective-c autolayout ios9 ios-autolayout


    【解决方案1】:

    所以显然约束所涉及的两个视图都需要调用 layoutIfNeeded。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-13
      • 2018-05-27
      • 1970-01-01
      相关资源
      最近更新 更多