Skip to content

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

@diamondfive

Description

@diamondfive

原始控件
[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];
}];

控件会错位平移

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions