添加键盘背景

This commit is contained in:
2025-11-04 21:01:46 +08:00
parent 3e2dc4bcb6
commit f43f94b94d
13 changed files with 528 additions and 15 deletions

View File

@@ -11,6 +11,7 @@
#import "KBFunctionView.h"
#import "KBKey.h"
#import "Masonry.h"
#import "KBSkinManager.h"
@interface KBKeyBoardMainView ()<KBToolBarDelegate, KBKeyboardViewDelegate>
@property (nonatomic, strong) KBToolBar *topBar;
@@ -21,7 +22,7 @@
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1.0];
self.backgroundColor = [KBSkinManager shared].current.keyboardBackground;
//
self.topBar = [[KBToolBar alloc] init];
self.topBar.delegate = self;
@@ -31,7 +32,7 @@
make.top.equalTo(self.mas_top).offset(6);
make.height.mas_equalTo(40);
}];
//
self.keyboardView = [[KBKeyboardView alloc] init];
self.keyboardView.delegate = self;
@@ -41,9 +42,9 @@
make.top.equalTo(self.topBar.mas_bottom).offset(4);
make.bottom.equalTo(self.mas_bottom).offset(-4);
}];
// /
}
return self;
}
@@ -114,5 +115,15 @@
//
// KeyboardViewController
#pragma mark - Theme
- (void)kb_applyTheme {
KBSkinManager *mgr = [KBSkinManager shared];
BOOL hasImg = ([mgr currentBackgroundImage] != nil);
UIColor *bg = mgr.current.keyboardBackground;
self.backgroundColor = hasImg ? [UIColor clearColor] : bg;
self.keyboardView.backgroundColor = hasImg ? [UIColor clearColor] : bg;
[self.keyboardView reloadKeys];
}
@end