From 10f159cfeee67541c6db2a72ef4adbce0569e5f2 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 27 Nov 2019 20:38:30 +0800 Subject: [PATCH] feat:disable subnode's bounce of refreshable node on iOS --- iOS/Pod/Classes/Shader/DoricListNode.m | 8 ++++++++ iOS/Pod/Classes/Shader/DoricScrollerNode.m | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/iOS/Pod/Classes/Shader/DoricListNode.m b/iOS/Pod/Classes/Shader/DoricListNode.m index aa1d75cc..7791bc71 100644 --- a/iOS/Pod/Classes/Shader/DoricListNode.m +++ b/iOS/Pod/Classes/Shader/DoricListNode.m @@ -22,6 +22,7 @@ #import "DoricExtensions.h" #import "DoricListItemNode.h" #import "DoricLayouts.h" +#import "DoricRefreshableNode.h" @interface DoricTableViewCell : UITableViewCell @property(nonatomic, strong) DoricListItemNode *doricListItemNode; @@ -73,6 +74,13 @@ - (instancetype)initWithContext:(DoricContext *)doricContext { return self; } +- (void)initWithSuperNode:(DoricSuperNode *)superNode { + [super initWithSuperNode:superNode]; + if ([superNode isKindOfClass:[DoricRefreshableNode class]]) { + self.view.bounces = NO; + } +} + - (UITableView *)build { return [[DoricTableView new] also:^(UITableView *it) { it.dataSource = self; diff --git a/iOS/Pod/Classes/Shader/DoricScrollerNode.m b/iOS/Pod/Classes/Shader/DoricScrollerNode.m index 4d601f15..ef7d699a 100644 --- a/iOS/Pod/Classes/Shader/DoricScrollerNode.m +++ b/iOS/Pod/Classes/Shader/DoricScrollerNode.m @@ -21,6 +21,7 @@ // #import "DoricScrollerNode.h" #import "DoricExtensions.h" +#import "DoricRefreshableNode.h" @implementation DoricScrollView @@ -56,6 +57,13 @@ - (DoricScrollView *)build { return [DoricScrollView new]; } +- (void)initWithSuperNode:(DoricSuperNode *)superNode { + [super initWithSuperNode:superNode]; + if ([superNode isKindOfClass:[DoricRefreshableNode class]]) { + self.view.bounces = NO; + } +} + - (void)blend:(NSDictionary *)props { [super blend:props]; NSDictionary *childModel = [self subModelOf:self.childViewId];