iOS Masonry动画
2021-07-15 本文已影响0人
OrrHsiao
[self.animationView.superView setNeedsLayout];
[self.animationView.superView layoutIfNeed];
[UIView animateWithDuration:0.25 animations:^{
[self.animationView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.offset(500);
}];
[self.animationView.superView layoutIfNeeded];
}];
做动画时,如果动画是从(0,0)点移动出来的,这表明动画视图的父视图的layoutSubViews里的布局还没有被渲染到屏幕上,需要手动调用父视图的layoutIfNeed