diff --git a/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/Contents.json b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/Contents.json new file mode 100644 index 0000000..ae052a8 --- /dev/null +++ b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/Contents.json @@ -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 + } +} diff --git a/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@2x.png b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@2x.png new file mode 100644 index 0000000..46e464f Binary files /dev/null and b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@2x.png differ diff --git a/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@3x.png b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@3x.png new file mode 100644 index 0000000..9f1e468 Binary files /dev/null and b/CustomKeyboard/KeyboardAssets.xcassets/back_keybord_icon.imageset/back_keybord_icon@3x.png differ diff --git a/CustomKeyboard/View/EmojiView/KBEmojiPanelView.m b/CustomKeyboard/View/EmojiView/KBEmojiPanelView.m index 36653f2..9258031 100644 --- a/CustomKeyboard/View/EmojiView/KBEmojiPanelView.m +++ b/CustomKeyboard/View/EmojiView/KBEmojiPanelView.m @@ -56,9 +56,10 @@ topBar.backgroundColor = [UIColor clearColor]; [self addSubview:topBar]; - self.backButton = [UIButton buttonWithType:UIButtonTypeSystem]; - self.backButton.titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightSemibold]; - [self.backButton setTitle:@"⌨︎" forState:UIControlStateNormal]; + self.backButton = [UIButton buttonWithType:UIButtonTypeCustom]; +// self.backButton.titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightSemibold]; +// [self.backButton setTitle:@"⌨︎" forState:UIControlStateNormal]; + [self.backButton setImage:[UIImage imageNamed:@"back_keybord_icon"] forState:UIControlStateNormal]; [self.backButton addTarget:self action:@selector(onBack) forControlEvents:UIControlEventTouchUpInside]; [topBar addSubview:self.backButton]; @@ -78,9 +79,9 @@ make.width.height.mas_equalTo(32); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.backButton.mas_right).offset(12); + make.centerX.equalTo(self); make.centerY.equalTo(topBar); - make.right.lessThanOrEqualTo(topBar.mas_right).offset(-12); +// make.right.lessThanOrEqualTo(topBar.mas_right).offset(-12); }]; UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new]; diff --git a/CustomKeyboard/View/KBKeyButton.m b/CustomKeyboard/View/KBKeyButton.m index 8024b36..0994495 100644 --- a/CustomKeyboard/View/KBKeyButton.m +++ b/CustomKeyboard/View/KBKeyButton.m @@ -152,7 +152,16 @@ // - caseVariant: 0/1/2 => 无变体/小写/大写 NSString *identifier = self.key.identifier; 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;