From 7408d9cfede10b5ac504d18d45c3a700ea6dfccf Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Mon, 23 Mar 2020 13:12:32 +0800 Subject: [PATCH] iOS:fix gradiantlayer frame nil --- doric-iOS/Pod/Classes/Shader/DoricViewNode.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m index 4a77640e..90b41dcd 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m @@ -144,6 +144,7 @@ - (void)blend:(NSDictionary *)props { [self blendView:self.view forPropName:key propValue:value]; } [self transformProperties]; + self.gradientLayer.frame = CGRectMake(0, 0, self.view.width, self.view.height); } - (void)transformProperties { @@ -173,13 +174,11 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop NSNumber *width = (NSNumber *) prop; if ([width floatValue] >= 0) { view.width = [width floatValue]; - self.gradientLayer.frame = view.bounds; } } else if ([name isEqualToString:@"height"]) { NSNumber *height = (NSNumber *) prop; if ([height floatValue] >= 0) { view.height = [height floatValue]; - self.gradientLayer.frame = view.bounds; } } else if ([name isEqualToString:@"x"]) { view.x = [prop floatValue];