iOS:fix yoga layout when is leaf,cause assertion

This commit is contained in:
pengfei.zhou 2020-04-15 18:36:50 +08:00 committed by osborn
parent 380673ef03
commit 5d306bbf67

View File

@ -39,6 +39,9 @@ - (CGSize)sizeThatFits:(CGSize)size {
} }
}]; }];
} }
if (self.yoga.isLeaf) {
return CGSizeZero;
}
return [self.yoga intrinsicSize]; return [self.yoga intrinsicSize];
} }
@end @end