From 9bf40727771c8c5d7896570cc178637a6de8ef55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Tue, 15 Jun 2021 16:06:57 +0800 Subject: [PATCH] fix: scroller parent aware child size change --- doric-iOS/Pod/Classes/Shader/DoricScrollerNode.m | 2 +- doric-iOS/Pod/Classes/Shader/DoricSuperNode.m | 1 + doric-iOS/Pod/Classes/Shader/DoricTextNode.m | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricScrollerNode.m b/doric-iOS/Pod/Classes/Shader/DoricScrollerNode.m index 896f8d68..376c5b1d 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricScrollerNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricScrollerNode.m @@ -123,7 +123,7 @@ - (void)afterBlended:(NSDictionary *)props { - (void)requestLayout { [self.childNode requestLayout]; - [self.view.contentView.doricLayout apply:self.view.frame.size]; + [self.view.doricLayout apply:self.view.frame.size]; } - (void)blendView:(DoricScrollView *)view forPropName:(NSString *)name propValue:(id)prop { diff --git a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m index 7b80268b..b1a76799 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m @@ -39,6 +39,7 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop [self mixinSubNode:subModel]; [self blendSubNode:subModel]; } + self.view.doricLayout.resolved = NO; } else { [super blendView:view forPropName:name propValue:prop]; } diff --git a/doric-iOS/Pod/Classes/Shader/DoricTextNode.m b/doric-iOS/Pod/Classes/Shader/DoricTextNode.m index bcd75046..fe3c8326 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricTextNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricTextNode.m @@ -186,6 +186,6 @@ - (void)reloadParagraphStyle { - (void)blend:(NSDictionary *)props { [super blend:props]; - [self.view.superview setNeedsLayout]; + self.view.doricLayout.resolved = NO; } @end