Skip to content

Commit e3ddb40

Browse files
guangyaoguangyao
authored andcommitted
增加一个方法,设置listview能否滚动的 AuroraIController.clickScrollEnabled(false)
1 parent f9ae58f commit e3ddb40

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ios/RCTAuroraIMUI/RCTAuroraIMUIModule.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ - (id)init {
9090
[[NSNotificationCenter defaultCenter] postNotificationName:@"StopPlayActivity" object: nil];
9191
}
9292

93+
RCT_EXPORT_METHOD(clickScrollEnabled:(BOOL)isScroll) {
94+
[[NSNotificationCenter defaultCenter] postNotificationName:@"clickScrollEnabled" object: [NSNumber numberWithBool:isScroll]];
95+
}
96+
9397
//RCT_EXPORT_METHOD(showOrigImage:(NSString *)msgID) {
9498
// [[NSNotificationCenter defaultCenter] postNotificationName:kShowOrigImageNotification object: msgID];
9599
//}

ios/RCTAuroraIMUI/RCTMessageListView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040

4141
@property (copy, nonatomic) NSArray *initalData;
42-
4342
// custom layout
4443
@property(strong, nonatomic) NSDictionary *sendBubble;
4544

ios/RCTAuroraIMUI/RCTMessageListView.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
118118
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickChangeHeight:) name:@"ChangeMessageListHeightNotification" object:nil];
119119
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickShowOrigImgView:) name:kShowOrigImageNotification object:nil];
120120
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickScanOrigImgView:) name:@"DWOrigImageViewScanNotificatiom" object:nil];
121+
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(clickScrollEnabled:) name:@"clickScrollEnabled" object:nil];
121122

122123
[self addObserver:self forKeyPath:@"bounds" options:NSKeyValueObservingOptionNew context:NULL];
123124

@@ -496,6 +497,10 @@ - (void)clickScanOrigImgView:(NSNotification *)noti{
496497

497498
}
498499

500+
- (void)clickScrollEnabled:(NSNotification *)noti{
501+
NSNumber *scrollNum = noti.object;
502+
self.messageList.messageCollectionView.scrollEnabled = [scrollNum boolValue];
503+
}
499504

500505
- (void)awakeFromNib {
501506
[super awakeFromNib];

0 commit comments

Comments
 (0)