Merge branch 'feature/fix_iOS_layout_container' into 'master'

fix sometimes call layoutsubviews while in layout



See merge request !6
This commit is contained in:
pengfeizhou 2019-11-01 19:23:45 +08:00
commit cd7893b83c

View File

@ -124,16 +124,19 @@ - (void)requestLayout {
}); });
} }
- (void)layoutSubviews {
[super layoutSubviews];
[self requestLayout];
}
- (void)setNeedsLayout { - (void)setNeedsLayout {
[super setNeedsLayout];
if (self.waitingLayout) { if (self.waitingLayout) {
return; return;
} }
[super setNeedsLayout]; [self requestLayout];
}
- (BOOL)waitingLayout {
if ([self.superview isKindOfClass:[DoricLayoutContainer class]]) {
return [(DoricLayoutContainer *) self.superview waitingLayout];
}
return _waitingLayout;
} }
- (void)layout { - (void)layout {