iOS:DoricLayout use marginLeft and marginTop instead of x or y
This commit is contained in:
parent
2a7c7bd27d
commit
e689d52f26
@ -65,8 +65,6 @@ typedef NS_ENUM(NSInteger, DoricGravity) {
|
|||||||
|
|
||||||
@property(nonatomic, assign) CGFloat width;
|
@property(nonatomic, assign) CGFloat width;
|
||||||
@property(nonatomic, assign) CGFloat height;
|
@property(nonatomic, assign) CGFloat height;
|
||||||
@property(nonatomic, assign) CGFloat x;
|
|
||||||
@property(nonatomic, assign) CGFloat y;
|
|
||||||
|
|
||||||
@property(nonatomic, assign) CGFloat spacing;
|
@property(nonatomic, assign) CGFloat spacing;
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@ - (DoricLayout *)doricLayout {
|
|||||||
layout = [DoricLayout new];
|
layout = [DoricLayout new];
|
||||||
layout.width = self.width;
|
layout.width = self.width;
|
||||||
layout.height = self.height;
|
layout.height = self.height;
|
||||||
layout.x = self.x;
|
|
||||||
layout.y = self.y;
|
|
||||||
layout.view = self;
|
layout.view = self;
|
||||||
self.doricLayout = layout;
|
self.doricLayout = layout;
|
||||||
}
|
}
|
||||||
@ -360,7 +358,7 @@ - (void)layoutStack {
|
|||||||
if (layout.marginLeft || layout.marginRight) {
|
if (layout.marginLeft || layout.marginRight) {
|
||||||
layout.measuredX = self.paddingLeft;
|
layout.measuredX = self.paddingLeft;
|
||||||
} else {
|
} else {
|
||||||
layout.measuredX = layout.x;
|
layout.measuredX = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((gravity & DoricGravityTop) == DoricGravityTop) {
|
if ((gravity & DoricGravityTop) == DoricGravityTop) {
|
||||||
@ -373,7 +371,7 @@ - (void)layoutStack {
|
|||||||
if (layout.marginTop || layout.marginBottom) {
|
if (layout.marginTop || layout.marginBottom) {
|
||||||
layout.measuredY = self.paddingTop;
|
layout.measuredY = self.paddingTop;
|
||||||
} else {
|
} else {
|
||||||
layout.measuredY = layout.y;
|
layout.measuredY = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,9 +173,9 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop
|
|||||||
} else if ([name isEqualToString:@"height"]) {
|
} else if ([name isEqualToString:@"height"]) {
|
||||||
view.doricLayout.height = [prop floatValue];
|
view.doricLayout.height = [prop floatValue];
|
||||||
} else if ([name isEqualToString:@"x"]) {
|
} else if ([name isEqualToString:@"x"]) {
|
||||||
view.doricLayout.x = [prop floatValue];
|
view.doricLayout.marginLeft = [prop floatValue];
|
||||||
} else if ([name isEqualToString:@"y"]) {
|
} else if ([name isEqualToString:@"y"]) {
|
||||||
view.doricLayout.y = [prop floatValue];
|
view.doricLayout.marginTop = [prop floatValue];
|
||||||
} else if ([name isEqualToString:@"backgroundColor"]) {
|
} else if ([name isEqualToString:@"backgroundColor"]) {
|
||||||
if ([prop isKindOfClass:[NSNumber class]]) {
|
if ([prop isKindOfClass:[NSNumber class]]) {
|
||||||
view.backgroundColor = DoricColor(prop);
|
view.backgroundColor = DoricColor(prop);
|
||||||
|
Reference in New Issue
Block a user