From 3eda0358d19cb43160ffcb5767d31f9faa19d4c9 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 20 Mar 2020 15:27:09 +0800 Subject: [PATCH] iOS:fix when set weight error --- doric-iOS/Pod/Classes/Shader/DoricLayouts.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m index d41c2358..7f42afcd 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m +++ b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m @@ -106,6 +106,13 @@ - (CGSize)measureSize:(CGSize)targetSize { if (config.heightSpec == DoricLayoutWrapContent) { height = contentSize.height + padding.top + padding.bottom; } + if (config.weight) { + if ([self.superview isKindOfClass:[DoricVLayoutView class]]) { + height = self.height; + } else if ([self.superview isKindOfClass:[DoricHLayoutView class]]) { + width = self.width; + } + } return CGSizeMake(width, height); }