iOS: FlexNode ignore maxSize if largger than intrinsic size when it is root flex node
This commit is contained in:
parent
3e1051ed4e
commit
c04994ab21
@ -246,6 +246,15 @@ - (void)requestLayout {
|
|||||||
self.view.yoga.marginEnd = YGValueZero;
|
self.view.yoga.marginEnd = YGValueZero;
|
||||||
self.view.yoga.marginVertical = YGValueZero;
|
self.view.yoga.marginVertical = YGValueZero;
|
||||||
self.view.yoga.marginHorizontal = YGValueZero;
|
self.view.yoga.marginHorizontal = YGValueZero;
|
||||||
|
CGSize size = self.view.yoga.intrinsicSize;
|
||||||
|
if (self.view.yoga.maxWidth.unit != YGUnitPoint
|
||||||
|
||(self.view.yoga.maxWidth.unit == YGUnitPoint && self.view.yoga.maxWidth.value > size.width)){
|
||||||
|
self.view.yoga.maxWidth = YGValueUndefined;
|
||||||
|
}
|
||||||
|
if (self.view.yoga.maxHeight.unit != YGUnitPoint
|
||||||
|
||(self.view.yoga.maxHeight.unit == YGUnitPoint && self.view.yoga.maxHeight.value > size.height)){
|
||||||
|
self.view.yoga.maxHeight = YGValueUndefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[self.view.yoga applyLayoutPreservingOrigin:YES];
|
[self.view.yoga applyLayoutPreservingOrigin:YES];
|
||||||
/// Need layout again.
|
/// Need layout again.
|
||||||
|
Reference in New Issue
Block a user