SnapKit / Masonry

Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
MIT License
18.05k stars 3.14k forks source link

缩小控件高度的动画 控件会错位平移 #592

Open diamondfive opened 3 years ago

diamondfive commented 3 years ago

原始控件 [self.testLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(10); make.top.mas_equalTo(200); make.width.mas_equalTo(200); make.height.mas_equalTo(200); }]; 平移动画: [UIView animateWithDuration:5.0f animations:^{

    [self.testLabel mas_updateConstraints:^(MASConstraintMaker *make) {

        make.height.mas_equalTo(100);
    }];

    [self.view layoutIfNeeded];
    [self.view.superview layoutIfNeeded];
}];

控件会错位平移