[_xibView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.offset(300);
make.width.offset(100);
make.height.offset(100);
}];
1. autolayout做动画需要调用系统方法
[self.view layoutIfNeeded];
例如:
[UIView animateWithDuration:0.5 animations:^{ // CGRect rect = _xibView.frame; // rect.origin.y = 300; // _xibView.frame = rect; // [_xibView mas_updateConstraints:^(MASConstraintMaker *make) { make.top.offset(300); make.width.offset(100); make.height.offset(100); }]; [self.view layoutIfNeeded]; } completion:^(BOOL finished) { }];
2. 没办法知道这个视图的真实尺寸
3. 难以修改或者这个视图的尺寸和位置约束
时间: 2024-10-24 17:50:23