添加键盘功能viewUI改动

This commit is contained in:
2025-11-26 21:16:56 +08:00
parent 80e4db86e4
commit 2435d760e8
17 changed files with 229 additions and 167 deletions

View File

@@ -106,16 +106,16 @@
[self.barViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.top.equalTo(self.mas_top).offset(6);
make.height.mas_equalTo(48);
make.height.mas_equalTo(52);
}];
//
[self addSubview:self.rightButtonContainer];
[self.rightButtonContainer mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.mas_right).offset(-6);
make.top.equalTo(self.barViewInternal.mas_bottom).offset(8);
make.right.equalTo(self.mas_right).offset(-4);
make.top.equalTo(self.barViewInternal.mas_bottom).offset(0);
make.bottom.equalTo(self.mas_bottom).offset(-10);
make.width.mas_equalTo(72);
make.width.mas_equalTo(60);
}];
//
@@ -125,10 +125,10 @@
[self.rightButtonContainer addSubview:self.sendButtonInternal];
//
CGFloat smallH = 44;
CGFloat smallH = 41;
CGFloat bigH = 56;
// 10 276 8 AutoLayout
CGFloat vSpace = 8;
CGFloat vSpace = 4;
[self.pasteButtonInternal mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.rightButtonContainer.mas_top);
make.left.right.equalTo(self.rightButtonContainer);
@@ -156,18 +156,18 @@
// 2.
[self addSubview:self.pasteViewInternal];
[self.pasteViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_left).offset(12);
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-12);
make.top.equalTo(self.barViewInternal.mas_bottom).offset(8);
make.height.mas_equalTo(48);
make.left.equalTo(self.mas_left).offset(vSpace);
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-vSpace);
make.top.equalTo(self.barViewInternal.mas_bottom).offset(0);
make.height.mas_equalTo(smallH);
}];
// 3. Tag List View
[self addSubview:self.tagListView];
[self.tagListView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_left).offset(12);
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-12);
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(10);
make.left.equalTo(self.pasteViewInternal);
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-vSpace);
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(vSpace);
make.bottom.equalTo(self.mas_bottom).offset(-10);
}];
}
@@ -176,13 +176,13 @@
- (void)reloadDemoData {
//
self.itemsInternal = @[KBLocalized(@"高情商"),
KBLocalized(@"暖味拉扯"),
KBLocalized(@"风趣幽默"),
KBLocalized(@"撩女生"),
KBLocalized(@"社交惬匿"),
KBLocalized(@"情场高手"),
KBLocalized(@"一枚暖男"),
self.itemsInternal = @[KBLocalized(@"Warm hearted man"),
KBLocalized(@"Warm2 hearted man"),
KBLocalized(@"Warm3 hearted man"),
KBLocalized(@"撩女生啊u发顺丰大师傅"),
KBLocalized(@"Warm = man"),
KBLocalized(@"Warm hearted man"),
KBLocalized(@"一枚暖男发放"),
KBLocalized(@"聊天搭子"),
KBLocalized(@"表达爱意"),
KBLocalized(@"更多话术")];
@@ -537,6 +537,9 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
- (void)functionBarView:(KBFunctionBarView *)bar didTapRightAtIndex:(NSInteger)index {
// /
if ([self.delegate respondsToSelector:@selector(functionView:didRightTapToolActionAtIndex:)]) {
[self.delegate functionView:self didRightTapToolActionAtIndex:index];
}
}
- (KBFunctionPasteView *)pasteViewInternal {
@@ -563,11 +566,11 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
}
- (UIButton *)buildRightButtonWithTitle:(NSString *)title color:(UIColor *)color {
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.backgroundColor = color;
btn.layer.cornerRadius = 12.0;
btn.layer.cornerRadius = 8.0;
btn.layer.masksToBounds = YES;
btn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
btn.titleLabel.font = [KBFont medium:13];
[btn setTitle:title forState:UIControlStateNormal];
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
return btn;
@@ -583,14 +586,12 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
- (UIButton *)deleteButtonInternal {
if (!_deleteButtonInternal) {
//
_deleteButtonInternal = [UIButton buttonWithType:UIButtonTypeSystem];
_deleteButtonInternal.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0];
_deleteButtonInternal.layer.cornerRadius = 12.0;
_deleteButtonInternal = [UIButton buttonWithType:UIButtonTypeCustom];
_deleteButtonInternal.backgroundColor = [UIColor colorWithHex:0xB9BDC8];
_deleteButtonInternal.layer.cornerRadius = 8.0;
_deleteButtonInternal.layer.masksToBounds = YES;
_deleteButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
[_deleteButtonInternal setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal];
[_deleteButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_deleteButtonInternal setImage:[UIImage imageNamed:@"kb_del_icon"] forState:UIControlStateNormal];
[_deleteButtonInternal addTarget:self action:@selector(onTapDelete) forControlEvents:UIControlEventTouchUpInside];
}
return _deleteButtonInternal;
@@ -598,11 +599,11 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
- (UIButton *)clearButtonInternal {
if (!_clearButtonInternal) {
_clearButtonInternal = [UIButton buttonWithType:UIButtonTypeSystem];
_clearButtonInternal.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0];
_clearButtonInternal.layer.cornerRadius = 12.0;
_clearButtonInternal = [UIButton buttonWithType:UIButtonTypeCustom];
_clearButtonInternal.backgroundColor = [UIColor colorWithHex:0xB9BDC8];
_clearButtonInternal.layer.cornerRadius = 8.0;
_clearButtonInternal.layer.masksToBounds = YES;
_clearButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_clearButtonInternal.titleLabel.font = [KBFont medium:13];
[_clearButtonInternal setTitle:KBLocalized(@"Clear") forState:UIControlStateNormal];
[_clearButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_clearButtonInternal addTarget:self action:@selector(onTapClear) forControlEvents:UIControlEventTouchUpInside];
@@ -610,9 +611,9 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
return _clearButtonInternal;
}
- (UIButton *)sendButtonInternal {
- (UIButton *)sendButtonInternal {
if (!_sendButtonInternal) {
_sendButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Send") color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
_sendButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Send") color:[UIColor colorWithHex:0x02BEAC]];
[_sendButtonInternal addTarget:self action:@selector(onTapSend) forControlEvents:UIControlEventTouchUpInside];
}
return _sendButtonInternal;