From e3824c2ee033fcbf097ee1cb7e45d8263df6e43c Mon Sep 17 00:00:00 2001 From: yangfan Date: Mon, 23 May 2022 09:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dspace=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99flex-weight=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=81=8F=E5=B7=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangfan Change-Id: I9a23780f7b1b18ec531cf07f7a992c00f6724434 --- frameworks/core/components/flex/render_flex.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frameworks/core/components/flex/render_flex.cpp b/frameworks/core/components/flex/render_flex.cpp index c2f0bf90662..5e2050538fd 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_; -- Gitee