diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m index 1e2080f7..e6240f93 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m @@ -246,6 +246,15 @@ - (void)requestLayout { self.view.yoga.marginEnd = YGValueZero; self.view.yoga.marginVertical = 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]; /// Need layout again.