This commit is contained in:
2025-12-16 20:20:57 +08:00
parent 59297eac77
commit b43567748c
5 changed files with 38 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "back_keybord_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "back_keybord_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -56,9 +56,10 @@
topBar.backgroundColor = [UIColor clearColor]; topBar.backgroundColor = [UIColor clearColor];
[self addSubview:topBar]; [self addSubview:topBar];
self.backButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.backButton.titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightSemibold]; // self.backButton.titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightSemibold];
[self.backButton setTitle:@"⌨︎" forState:UIControlStateNormal]; // [self.backButton setTitle:@"⌨︎" forState:UIControlStateNormal];
[self.backButton setImage:[UIImage imageNamed:@"back_keybord_icon"] forState:UIControlStateNormal];
[self.backButton addTarget:self action:@selector(onBack) forControlEvents:UIControlEventTouchUpInside]; [self.backButton addTarget:self action:@selector(onBack) forControlEvents:UIControlEventTouchUpInside];
[topBar addSubview:self.backButton]; [topBar addSubview:self.backButton];
@@ -78,9 +79,9 @@
make.width.height.mas_equalTo(32); make.width.height.mas_equalTo(32);
}]; }];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.backButton.mas_right).offset(12); make.centerX.equalTo(self);
make.centerY.equalTo(topBar); make.centerY.equalTo(topBar);
make.right.lessThanOrEqualTo(topBar.mas_right).offset(-12); // make.right.lessThanOrEqualTo(topBar.mas_right).offset(-12);
}]; }];
UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new]; UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new];

View File

@@ -152,7 +152,16 @@
// - caseVariant: 0/1/2 => // // - caseVariant: 0/1/2 => //
NSString *identifier = self.key.identifier; NSString *identifier = self.key.identifier;
NSInteger variant = (NSInteger)self.key.caseVariant; NSInteger variant = (NSInteger)self.key.caseVariant;
UIImage *iconImg = [[KBSkinManager shared] iconImageForKeyIdentifier:identifier caseVariant:variant]; KBSkinManager *skinManager = [KBSkinManager shared];
UIImage *iconImg = [skinManager iconImageForKeyIdentifier:identifier caseVariant:variant];
if (!iconImg && [identifier isEqualToString:@"ai"]) {
NSString *skinId = skinManager.current.skinId ?: @"";
BOOL usingDefaultSkin = (skinId.length == 0 || [skinId isEqualToString:@"default"]);
if (usingDefaultSkin) {
iconImg = [UIImage imageNamed:@"ai_key_icon"];
}
}
// //
self.iconView.image = iconImg; self.iconView.image = iconImg;