iOS: FlexLayout's root node do not enable margin
This commit is contained in:
parent
834d98cdb7
commit
3a1d07ecc4
@ -236,6 +236,17 @@ - (void)requestLayout {
|
|||||||
if (self.view.doricLayout.heightSpec != DoricLayoutFit) {
|
if (self.view.doricLayout.heightSpec != DoricLayoutFit) {
|
||||||
self.view.yoga.height = YGPointValue(self.view.height);
|
self.view.yoga.height = YGPointValue(self.view.height);
|
||||||
}
|
}
|
||||||
|
if (![self.superNode isKindOfClass:DoricFlexNode.class]) {
|
||||||
|
self.view.yoga.margin = YGValueZero;
|
||||||
|
self.view.yoga.marginLeft = YGValueZero;
|
||||||
|
self.view.yoga.marginRight = YGValueZero;
|
||||||
|
self.view.yoga.marginTop = YGValueZero;
|
||||||
|
self.view.yoga.marginBottom = YGValueZero;
|
||||||
|
self.view.yoga.marginStart = YGValueZero;
|
||||||
|
self.view.yoga.marginEnd = YGValueZero;
|
||||||
|
self.view.yoga.marginVertical = YGValueZero;
|
||||||
|
self.view.yoga.marginHorizontal = YGValueZero;
|
||||||
|
}
|
||||||
[self.view.yoga applyLayoutPreservingOrigin:YES];
|
[self.view.yoga applyLayoutPreservingOrigin:YES];
|
||||||
/// Need layout again.
|
/// Need layout again.
|
||||||
for (UIView *view in self.view.subviews) {
|
for (UIView *view in self.view.subviews) {
|
||||||
|
Reference in New Issue
Block a user