AI键移除 放在顶部KBToolBar
This commit is contained in:
@@ -277,10 +277,6 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
||||
title:@"123"
|
||||
output:@""
|
||||
type:KBKeyTypeModeChange];
|
||||
KBKey *customAI = [KBKey keyWithIdentifier:@"ai"
|
||||
title:@"AI"
|
||||
output:@""
|
||||
type:KBKeyTypeCustom];
|
||||
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
||||
title:@"😊"
|
||||
output:@""
|
||||
@@ -293,7 +289,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
||||
title:KBLocalized(@"Send")
|
||||
output:@"\n"
|
||||
type:KBKeyTypeReturn];
|
||||
return @[ mode123, customAI, emoji, space, ret ];
|
||||
return @[ mode123, emoji, space, ret ];
|
||||
}
|
||||
|
||||
// 底部控制行(数字布局)
|
||||
@@ -302,10 +298,6 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
||||
title:@"abc"
|
||||
output:@""
|
||||
type:KBKeyTypeModeChange];
|
||||
KBKey *customAI = [KBKey keyWithIdentifier:@"ai"
|
||||
title:@"AI"
|
||||
output:@""
|
||||
type:KBKeyTypeCustom];
|
||||
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
||||
title:@"😊"
|
||||
output:@""
|
||||
@@ -318,7 +310,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
||||
title:KBLocalized(@"Send")
|
||||
output:@"\n"
|
||||
type:KBKeyTypeReturn];
|
||||
return @[ modeABC, customAI, emoji, space, ret ];
|
||||
return @[ modeABC, emoji, space, ret ];
|
||||
}
|
||||
|
||||
#pragma mark - Row Building
|
||||
@@ -332,7 +324,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
||||
edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
||||
|
||||
// 第 4 行(底部控制行)使用单独的布局规则:
|
||||
// 123/ABC、AI、Send 给定尺寸,Space 自动吃掉剩余宽度。
|
||||
// 123/ABC、Emoji、Send 给定尺寸,Space 自动吃掉剩余宽度。
|
||||
BOOL isBottomControlRow = [self kb_isBottomControlRowWithKeys:keys];
|
||||
|
||||
CGFloat spacing = 0; // 键与键之间的间距
|
||||
@@ -419,7 +411,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
||||
}];
|
||||
}
|
||||
|
||||
// 底部控制行:在第一轮已完成左右约束的前提下,仅给 123/ABC、AI、Send 指定宽度,
|
||||
// 底部控制行:在第一轮已完成左右约束的前提下,仅给 123/ABC、Emoji、Send 指定宽度,
|
||||
// Space 不加宽度约束,让其自动填充剩余空间。
|
||||
if (isBottomControlRow) {
|
||||
[self kb_applyBottomControlRowWidthInRow:row];
|
||||
@@ -448,7 +440,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
||||
}
|
||||
}
|
||||
if (firstChar) {
|
||||
// 如果该行本身没有字符键(如底部控制行),且基准按钮是 123/ABC/AI/#+= 等,
|
||||
// 如果该行本身没有字符键(如底部控制行),且基准按钮是 123/ABC/#+= 等,
|
||||
// 也将其约束为 1:1,避免 123/ABC 不是正方形。
|
||||
if (!hasCharacterInRow &&
|
||||
(firstChar.key.type == KBKeyTypeModeChange ||
|
||||
@@ -540,7 +532,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
||||
}
|
||||
|
||||
// 为底部控制行设置宽度:
|
||||
// - 123/ABC、AI:正方形(宽 = 行高 * multiplier)
|
||||
// - 123/ABC、Emoji:正方形(宽 = 行高 * multiplier)
|
||||
// - Send:宽 = 模式键宽度的 2 倍
|
||||
// - Space:不加宽度约束,依靠左右约束自动填充剩余空间。
|
||||
- (void)kb_applyBottomControlRowWidthInRow:(UIView *)row {
|
||||
|
||||
Reference in New Issue
Block a user