1 Commits

Author SHA1 Message Date
6f7bb4f960 键盘的背景图添加高斯模糊 2026-02-03 14:22:44 +08:00

View File

@@ -78,6 +78,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
@property(nonatomic, strong) UIImageView *bgImageView; //
@property(nonatomic, strong) UIImageView *personaAvatarImageView; // persona
@property(nonatomic, strong) UIImageView *personaGrayImageView; // persona
@property(nonatomic, strong) UIVisualEffectView *personaBlurView; //
@property(nonatomic, strong) KBChatPanelView *chatPanelView;
@property(nonatomic, strong) KBKeyboardSubscriptionView *subscriptionView;
@@ -1407,6 +1408,10 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
_personaAvatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_personaAvatarImageView.clipsToBounds = YES;
_personaAvatarImageView.hidden = YES;
[_personaAvatarImageView addSubview:self.personaBlurView];
[self.personaBlurView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(_personaAvatarImageView);
}];
}
return _personaAvatarImageView;
}
@@ -1419,6 +1424,16 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
return _personaGrayImageView;
}
- (UIVisualEffectView *)personaBlurView {
if (!_personaBlurView) {
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
_personaBlurView = [[UIVisualEffectView alloc] initWithEffect:effect];
_personaBlurView.hidden = YES;
_personaBlurView.userInteractionEnabled = NO;
}
return _personaBlurView;
}
#pragma mark - Persona Avatar
/// AppGroup persona
@@ -1475,6 +1490,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
if (image) {
self.personaAvatarImageView.image = image;
self.personaAvatarImageView.hidden = NO;
self.personaBlurView.hidden = NO;
NSLog(@"[Keyboard] persona 封面图加载成功");
} else {
NSLog(@"[Keyboard] persona 封面图加载失败");
@@ -1485,6 +1501,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
- (void)kb_hidePersonaAvatar {
self.personaAvatarImageView.hidden = YES;
self.personaAvatarImageView.image = nil;
self.personaBlurView.hidden = YES;
}
#pragma mark - Actions