清理键盘emoji内存高的问题

This commit is contained in:
2026-03-04 15:06:49 +08:00
parent fd5de4f197
commit 5c0cf2b435
6 changed files with 158 additions and 22 deletions

View File

@@ -30,6 +30,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 高亮指定分类
- (void)selectCategoryAtIndex:(NSInteger)index;
/// 释放 emoji 数据缓存(隐藏面板时可用)
- (void)purgeEmojiCache;
@end
NS_ASSUME_NONNULL_END

View File

@@ -185,6 +185,15 @@
[self updateSelectionToIndex:preserved];
}
- (void)purgeEmojiCache {
[self.dataProvider purgeLargeCaches];
self.categories = @[];
self.currentIndex = NSNotFound;
self.titleLabel.text = @"";
[self rebuildTabButtons];
[self.collectionView reloadData];
}
- (void)rebuildTabButtons {
UIStackView *stackView = self.bottomBar.tabStackView;
if (!stackView) { return; }