From 5d306bbf67e5e200701b43b5ad280af90639c157 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 15 Apr 2020 18:36:50 +0800 Subject: [PATCH] iOS:fix yoga layout when is leaf,cause assertion --- doric-iOS/Pod/Classes/Shader/DoricFlexNode.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m index 937b91cd..c734bad1 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlexNode.m @@ -39,6 +39,9 @@ - (CGSize)sizeThatFits:(CGSize)size { } }]; } + if (self.yoga.isLeaf) { + return CGSizeZero; + } return [self.yoga intrinsicSize]; } @end