iOS: fix flexlayout when sometimes width is not correct
This commit is contained in:
parent
8e22108cc9
commit
51d1c5c91b
@ -1530,15 +1530,14 @@ - (void)layoutFlex {
|
|||||||
if (layout.disabled) {
|
if (layout.disabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (layout.layoutType == DoricFlexLayout) {
|
|
||||||
[layout measureWidth:DoricMeasureSpecMake(DoricMeasureExactly,
|
|
||||||
YGNodeLayoutGetWidth(child.yoga.node))
|
|
||||||
height:DoricMeasureSpecMake(DoricMeasureExactly,
|
|
||||||
YGNodeLayoutGetHeight(child.yoga.node))];
|
|
||||||
}
|
|
||||||
[layout layout];
|
|
||||||
layout.measuredX = YGNodeLayoutGetLeft(child.yoga.node);
|
layout.measuredX = YGNodeLayoutGetLeft(child.yoga.node);
|
||||||
layout.measuredY = YGNodeLayoutGetTop(child.yoga.node);
|
layout.measuredY = YGNodeLayoutGetTop(child.yoga.node);
|
||||||
|
CGSize size = child.yoga.intrinsicSize;
|
||||||
|
[layout measureWidth:DoricMeasureSpecMake(DoricMeasureExactly,
|
||||||
|
size.width)
|
||||||
|
height:DoricMeasureSpecMake(DoricMeasureExactly,
|
||||||
|
size.height)];
|
||||||
|
[layout layout];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user