From 98db105a73c895bb0402a9c76527372ea99e0e28 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 7 May 2021 19:04:46 +0800 Subject: [PATCH] iOS: fix when set padding --- doric-iOS/Pod/Classes/Shader/DoricLayouts.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m index f69bfe9a..377c4651 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m +++ b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m @@ -429,10 +429,10 @@ - (void)layoutStack { continue; } if (self.widthSpec == DoricLayoutFit && layout.widthSpec == DoricLayoutMost) { - layout.measuredWidth = self.measuredWidth - layout.marginLeft - layout.marginRight; + layout.measuredWidth = self.contentWidth - layout.marginLeft - layout.marginRight; } if (self.heightSpec == DoricLayoutFit && layout.heightSpec == DoricLayoutMost) { - layout.measuredHeight = self.measuredHeight - layout.marginTop - layout.marginBottom; + layout.measuredHeight = self.contentHeight - layout.marginTop - layout.marginBottom; } [layout layout]; DoricGravity gravity = layout.alignment; @@ -488,7 +488,7 @@ - (void)layoutVLayout { continue; } if (self.widthSpec == DoricLayoutFit && layout.widthSpec == DoricLayoutMost) { - layout.measuredWidth = self.measuredWidth - layout.marginLeft - layout.marginRight; + layout.measuredWidth = self.contentWidth - layout.marginLeft - layout.marginRight; } [layout layout]; DoricGravity gravity = layout.alignment | self.gravity; @@ -531,7 +531,7 @@ - (void)layoutHLayout { } if (self.heightSpec == DoricLayoutFit && layout.heightSpec == DoricLayoutMost) { - layout.measuredHeight = self.measuredHeight - layout.marginTop - layout.marginBottom; + layout.measuredHeight = self.contentHeight - layout.marginTop - layout.marginBottom; } [layout layout];