iOS refact DoricLayout

This commit is contained in:
pengfei.zhou
2020-04-03 16:36:43 +08:00
committed by osborn
parent ca6a3284f2
commit abbe0ba377
32 changed files with 540 additions and 761 deletions

View File

@@ -21,18 +21,21 @@
//
#import "DoricVLayoutNode.h"
#import "DoricExtensions.h"
@implementation DoricVLayoutNode
- (DoricVLayoutView *)build {
return [DoricVLayoutView new];
- (UIView *)build {
return [[UIView new] also:^(UIView *it) {
it.doricLayout.layoutType = DoricVLayout;
}];
}
- (void)blendView:(DoricVLayoutView *)view forPropName:(NSString *)name propValue:(id)prop {
- (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop {
if ([name isEqualToString:@"gravity"]) {
view.gravity = (DoricGravity) [(NSNumber *) prop integerValue];
view.doricLayout.gravity = (DoricGravity) [(NSNumber *) prop integerValue];
} else if ([name isEqualToString:@"space"]) {
view.space = [(NSNumber *) prop floatValue];
view.doricLayout.spacing = [(NSNumber *) prop floatValue];
} else {
[super blendView:view forPropName:name propValue:prop];
}