预先定义一个约束的全局变量,用来接收需要变化的约束
@property (nonatomic, strong) MASConstraint *bottomViewBottom;
[self.bottomViewBottom uninstall];
[UIView animateWithDuration:0.3 animations:^{
[self.bottomViewmas_updateConstraints:^(MASConstraintMaker*make) {
self.bottomViewBottom= make.bottom.mas_equalTo(-300);
}];
[self.viewlayoutIfNeeded]; //一定要加,---父视图--- 刷新
}];