diff --git a/frameworks/core/components/flex/render_flex.cpp b/frameworks/core/components/flex/render_flex.cpp index c2f0bf906624047043454301200bad8ffcb6c73f..5e2050538fd8a0349f8115407a28de4e3ae239c7 100644 --- a/frameworks/core/components/flex/render_flex.cpp +++ b/frameworks/core/components/flex/render_flex.cpp @@ -280,6 +280,9 @@ void RenderFlex::PerformLayoutInWeightMode() LOGW("not supported infinite size"); return; } + if (!relativeNodes_.empty()) { + maxMainSize -= GetSpace() * (relativeNodes_.size() - 1); + } BaselineProperties baselineProperties; LayoutParam innerLayout; double allocatedSize = allocatedSize_;