Skip to content

Commit 7b6b9f4

Browse files
committed
解决表情加载卡顿的问题
暂时使用延时加载方式
1 parent ceab3a3 commit 7b6b9f4

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

ios/RCTAuroraIMUI/DWCustomView/DWEmoticonView/NIMInputEmoticonContainerView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ - (instancetype)initWithFrame:(CGRect)frame
4343
- (void)loadConfig{
4444
self.backgroundColor = [UIColor clearColor];
4545
[self loadUIComponents];
46-
[self reloadData];
46+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
47+
[self reloadData];
48+
});
49+
// [self reloadData];
4750
}
4851

4952

ios/RCTAuroraIMUI/DWCustomView/DWEmoticonView/NIMInputEmoticonTabView.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ - (void)onTouchTab:(id)sender{
8585
NSInteger index = [self.tabs indexOfObject:sender];
8686
[self selectTabIndex:index];
8787
if ([self.delegate respondsToSelector:@selector(tabView:didSelectTabIndex:)]) {
88-
[self.delegate tabView:self didSelectTabIndex:index];
88+
89+
// [self.delegate tabView:self didSelectTabIndex:index];
90+
dispatch_async(dispatch_get_main_queue(), ^{
91+
[self.delegate tabView:self didSelectTabIndex:index];
92+
});
8993
}
9094
}
9195

ios/RCTAuroraIMUI/DWCustomView/DWEmoticonView/NIMPageView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ - (id)initWithFrame:(CGRect)frame
4242
- (void)clickLoadPages{
4343
if (!_isLoaded) {
4444
_isLoaded = YES;
45-
dispatch_async(dispatch_get_main_queue(), ^{
45+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
4646
[self reloadData];
4747
});
48+
// dispatch_async(dispatch_get_main_queue(), ^{
49+
// [self reloadData];
50+
// });
4851
}
4952
}
5053

ios/RCTAuroraIMUI/RCTAuroraIMUIModule.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ - (id)init {
7272
RCT_EXPORT_METHOD(clickGetAtPerson:(NSDictionary *)person) {
7373
[[NSNotificationCenter defaultCenter] postNotificationName:GetAtPersonNotification object:person];
7474
}
75-
75+
// 此方式没有作用
7676
RCT_EXPORT_METHOD(clickLoadEmotionPages) {
77-
[[NSNotificationCenter defaultCenter] postNotificationName:LoadPagesNotification object:nil];
77+
// [[NSNotificationCenter defaultCenter] postNotificationName:LoadPagesNotification object:nil];
7878
}
7979

8080

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
]
2424
],
2525
"_from": "git+https://github.com/reactnativecomponent/react-native-imui.git",
26-
"_id": "react-native-imui@1.0.8",
26+
"_id": "react-native-imui@1.0.9",
2727
"_inCache": true,
2828
"_location": "/react-native-imui",
2929
"_phantomChildren": {},
@@ -81,5 +81,5 @@
8181
"scripts": {
8282
"test": "echo \"Error: no test specified\" && exit 1"
8383
},
84-
"version": "1.0.8"
84+
"version": "1.0.9"
8585
}

0 commit comments

Comments
 (0)