关于 masonry 给 mas_updateConstraints 添加动画

 代码如下:[self layoutIfNeeded];必须加上,否则动画不生效

[UIView animateWithDuration:0.25 animations:^{
    [self.checkBoxBtn mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(100);
        make.left.mas_equalTo(50);
        make.width.mas_equalTo(25);
        make.height.mas_equalTo(25);
    }];
                
    [self layoutIfNeeded];// 需要在此处调用layoutIfNeeded方法才能产生动画
}];

你可能感兴趣的:(iOS,macos,objective-c,ios,xcode,masonry,rac)