Add unit test. Fix the layout for non-UIView subclasses

This commit is contained in:
Pavel Mazurin
2017-07-31 15:43:15 +02:00
parent 010d1bb0c2
commit 6366ee45ab
2 changed files with 12 additions and 1 deletions

View File

@@ -306,7 +306,8 @@ static YGSize YGMeasureView(
UIView *view = (__bridge UIView*) YGNodeGetContext(node);
CGSize sizeThatFits = CGSizeZero;
if ([view.subviews count] > 0) {
// Fix for https://github.com/facebook/yoga/issues/606
if (![view isMemberOfClass:[UIView class]] || [view.subviews count] > 0) {
sizeThatFits = [view sizeThatFits:(CGSize) {
.width = constrainedWidth,
.height = constrainedHeight,