添加键盘功能viewUI改动
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user