修改emoji
This commit is contained in:
@@ -279,6 +279,10 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
title:@"123"
|
title:@"123"
|
||||||
output:@""
|
output:@""
|
||||||
type:KBKeyTypeModeChange];
|
type:KBKeyTypeModeChange];
|
||||||
|
KBKey *customAI = [KBKey keyWithIdentifier:@"ai"
|
||||||
|
title:@"AI"
|
||||||
|
output:@""
|
||||||
|
type:KBKeyTypeCustom];
|
||||||
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
||||||
title:@"😊"
|
title:@"😊"
|
||||||
output:@""
|
output:@""
|
||||||
@@ -291,7 +295,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
title:KBLocalized(@"Send")
|
title:KBLocalized(@"Send")
|
||||||
output:@"\n"
|
output:@"\n"
|
||||||
type:KBKeyTypeReturn];
|
type:KBKeyTypeReturn];
|
||||||
return @[ mode123, emoji, space, ret ];
|
return @[ mode123, customAI, emoji, space, ret ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 底部控制行(数字布局)
|
// 底部控制行(数字布局)
|
||||||
@@ -300,6 +304,10 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
title:@"abc"
|
title:@"abc"
|
||||||
output:@""
|
output:@""
|
||||||
type:KBKeyTypeModeChange];
|
type:KBKeyTypeModeChange];
|
||||||
|
KBKey *customAI = [KBKey keyWithIdentifier:@"ai"
|
||||||
|
title:@"AI"
|
||||||
|
output:@""
|
||||||
|
type:KBKeyTypeCustom];
|
||||||
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
KBKey *emoji = [KBKey keyWithIdentifier:KBKeyIdentifierEmojiPanel
|
||||||
title:@"😊"
|
title:@"😊"
|
||||||
output:@""
|
output:@""
|
||||||
@@ -312,7 +320,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
title:KBLocalized(@"Send")
|
title:KBLocalized(@"Send")
|
||||||
output:@"\n"
|
output:@"\n"
|
||||||
type:KBKeyTypeReturn];
|
type:KBKeyTypeReturn];
|
||||||
return @[ modeABC, emoji, space, ret ];
|
return @[ modeABC, customAI, emoji, space, ret ];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Row Building
|
#pragma mark - Row Building
|
||||||
@@ -545,7 +553,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
|||||||
// - Space:不加宽度约束,依靠左右约束自动填充剩余空间。
|
// - Space:不加宽度约束,依靠左右约束自动填充剩余空间。
|
||||||
- (void)kb_applyBottomControlRowWidthInRow:(UIView *)row {
|
- (void)kb_applyBottomControlRowWidthInRow:(UIView *)row {
|
||||||
KBKeyButton *modeBtn = nil;
|
KBKeyButton *modeBtn = nil;
|
||||||
KBKeyButton *aiBtn = nil;
|
NSMutableArray<KBKeyButton *> *customButtons = [NSMutableArray array];
|
||||||
KBKeyButton *spaceBtn = nil;
|
KBKeyButton *spaceBtn = nil;
|
||||||
KBKeyButton *retBtn = nil;
|
KBKeyButton *retBtn = nil;
|
||||||
|
|
||||||
@@ -558,7 +566,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
|||||||
modeBtn = b;
|
modeBtn = b;
|
||||||
break;
|
break;
|
||||||
case KBKeyTypeCustom:
|
case KBKeyTypeCustom:
|
||||||
aiBtn = b;
|
[customButtons addObject:b];
|
||||||
break;
|
break;
|
||||||
case KBKeyTypeSpace:
|
case KBKeyTypeSpace:
|
||||||
spaceBtn = b;
|
spaceBtn = b;
|
||||||
@@ -571,19 +579,19 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!modeBtn || !aiBtn || !spaceBtn || !retBtn) {
|
if (!modeBtn || customButtons.count == 0 || !spaceBtn || !retBtn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 行高由外部约束为固定值(等于 row1 高度),这里用行高作为“正方形”的边长。
|
|
||||||
[modeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[modeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.width.equalTo(row.mas_height).multipliedBy(kKBSpecialKeySquareMultiplier);
|
make.width.equalTo(row.mas_height).multipliedBy(kKBSpecialKeySquareMultiplier);
|
||||||
}];
|
}];
|
||||||
[aiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
for (KBKeyButton *custom in customButtons) {
|
||||||
make.width.equalTo(row.mas_height).multipliedBy(kKBSpecialKeySquareMultiplier);
|
[custom mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
}];
|
make.width.equalTo(row.mas_height).multipliedBy(kKBSpecialKeySquareMultiplier);
|
||||||
|
}];
|
||||||
|
}
|
||||||
[retBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[retBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
// Send 按钮:宽度为模式键的 2 倍
|
|
||||||
make.width.equalTo(modeBtn.mas_width).multipliedBy(2.0);
|
make.width.equalTo(modeBtn.mas_width).multipliedBy(2.0);
|
||||||
}];
|
}];
|
||||||
// Space 不设置宽度;通过此前已建立的左右约束自动占满剩余宽度。
|
// Space 不设置宽度;通过此前已建立的左右约束自动占满剩余宽度。
|
||||||
|
|||||||
Reference in New Issue
Block a user