From e4e5103d7b0b5d69e267e95753ab278949edda86 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 7 Apr 2020 11:36:35 +0800 Subject: [PATCH] iOS:fix GradientLayer --- doric-iOS/Pod/Classes/Shader/DoricViewNode.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m index bc72455c..ba16c72d 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m @@ -140,7 +140,11 @@ - (void)blend:(NSDictionary *)props { [self afterBlended:props]; [self transformProperties]; [self requestLayout]; - self.gradientLayer.frame = CGRectMake(0, 0, self.view.width, self.view.height); + [self.gradientLayer also:^(CAGradientLayer* it) { + dispatch_async(dispatch_get_main_queue(), ^{ + it.frame = CGRectMake(0, 0, self.view.width, self.view.height); + }); + }]; } - (void)afterBlended:(NSDictionary *)props {