diff --git a/iOS/Pod/Classes/Shader/DoricViewNode.m b/iOS/Pod/Classes/Shader/DoricViewNode.m index 8a075403..3132c179 100644 --- a/iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/iOS/Pod/Classes/Shader/DoricViewNode.m @@ -69,7 +69,33 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop view.userInteractionEnabled = YES; UITapGestureRecognizer *tapGesturRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onClick:)]; [view addGestureRecognizer:tapGesturRecognizer]; - }else { + } else if([name isEqualToString:@"border"]) { + NSDictionary *dic = prop; + CGFloat width = [(NSNumber *)[dic objectForKey:@"width"] floatValue]; + UIColor *color = DoricColor((NSNumber *)[dic objectForKey:@"color"]); + view.layer.borderWidth = width; + view.layer.borderColor = color.CGColor; + } else if([name isEqualToString:@"corners"]) { + if([prop isKindOfClass:NSNumber.class]) { + view.layer.cornerRadius = [(NSNumber *)prop floatValue]; + } else if([prop isKindOfClass:NSDictionary.class]) { + + } + } else if([name isEqualToString:@"shadow"]) { + NSDictionary *dic = prop; + CGFloat opacity = [(NSNumber *)[dic objectForKey:@"opacity"] floatValue]; + if (opacity > CGFLOAT_MIN) { + view.clipsToBounds = NO; + UIColor *color = DoricColor((NSNumber *)[dic objectForKey:@"color"]); + view.layer.shadowColor = color.CGColor; + view.layer.shadowRadius = [(NSNumber *)[dic objectForKey:@"radius"] floatValue]; + view.layer.shadowOffset = CGSizeMake([(NSNumber *)[dic objectForKey:@"offsetX"] floatValue],[(NSNumber *)[dic objectForKey:@"offsetY"] floatValue]); + view.layer.shadowOpacity = opacity; + } else { + view.clipsToBounds = YES; + } + + } else { DoricLog(@"Blend View error for View Type :%@, prop is %@", self.class, name); } } diff --git a/js-framework/demo.ts b/js-framework/demo.ts index dd65ac07..59817354 100644 --- a/js-framework/demo.ts +++ b/js-framework/demo.ts @@ -25,7 +25,7 @@ class CounterView extends ViewHolder { color: Color.parse('#000000'), } this.counter.textSize = 20 - //this.counter.corners = 5 + this.counter.corners = 5 vlayout.space = 20 vlayout.layoutConfig = { alignment: new Gravity().center()