首页加载默认皮肤

This commit is contained in:
2026-03-02 20:52:02 +08:00
parent fb6db0649c
commit 2505de0f24
4 changed files with 47 additions and 7 deletions

View File

@@ -74,6 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface KBKeyboardLayout : NSObject
@property (nonatomic, strong, nullable) NSArray<KBKeyboardRowConfig *> *rows;
@property (nonatomic, strong, nullable) NSArray<KBKeyboardRowConfig *> *shiftRows;
@end
@interface KBKeyboardLayoutConfig : NSObject

View File

@@ -82,7 +82,7 @@ static NSString * const kKBKeyboardLayoutI18nFileName = @"kb_keyboard_layouts_i1
@implementation KBKeyboardLayout
+ (NSDictionary *)mj_objectClassInArray {
return @{ @"rows": [KBKeyboardRowConfig class] };
return @{ @"rows": [KBKeyboardRowConfig class], @"shiftRows": [KBKeyboardRowConfig class] };
}
@end

View File

@@ -127,7 +127,14 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
}
KBKeyboardLayout *layout = [self kb_currentLayout];
NSArray<KBKeyboardRowConfig *> *rows = layout.rows ?: @[];
NSArray<KBKeyboardRowConfig *> *rows = nil;
if (self.shiftOn && layout.shiftRows.count > 0) {
rows = layout.shiftRows;
} else {
rows = layout.rows ?: @[];
}
if (rows.count < 4) {
[self kb_buildLegacyLayout];
return;