添加键盘功能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

@@ -7,10 +7,13 @@
#import "KBFunctionPasteView.h"
#import "Masonry.h"
#import "KBFont.h"
@interface KBFunctionPasteView ()
@property (nonatomic, strong) UIImageView *iconViewInternal;
@property (nonatomic, strong) UILabel *placeholderLabelInternal;
@property (nonatomic, strong) UIButton *pasBtn;
@end
@implementation KBFunctionPasteView
@@ -22,19 +25,24 @@
self.layer.cornerRadius = 12.0;
self.layer.masksToBounds = YES;
[self addSubview:self.iconViewInternal];
[self addSubview:self.placeholderLabelInternal];
// [self addSubview:self.iconViewInternal];
// [self addSubview:self.placeholderLabelInternal];
[self addSubview:self.pasBtn];
[self.pasBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_left).offset(12);
make.centerY.equalTo(self.mas_centerY);
make.width.height.mas_equalTo(20);
}];
[self.placeholderLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.iconViewInternal.mas_right).offset(8);
make.right.equalTo(self.mas_right).offset(-12);
make.centerY.equalTo(self.mas_centerY);
}];
// [self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.mas_left).offset(12);
// make.centerY.equalTo(self.mas_centerY);
// make.width.height.mas_equalTo(20);
// }];
// [self.placeholderLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.iconViewInternal.mas_right).offset(8);
// make.right.equalTo(self.mas_right).offset(-12);
// make.centerY.equalTo(self.mas_centerY);
// }];
}
return self;
}
@@ -44,15 +52,7 @@
- (UIImageView *)iconViewInternal {
if (!_iconViewInternal) {
_iconViewInternal = [[UIImageView alloc] init];
//
UILabel *emoji = [[UILabel alloc] init];
emoji.text = @"📋"; // /
emoji.font = [UIFont systemFontOfSize:18];
emoji.textAlignment = NSTextAlignmentCenter;
[_iconViewInternal addSubview:emoji];
[emoji mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(_iconViewInternal);
}];
_iconViewInternal.image = [UIImage imageNamed:@"kb_zt_icon"];
}
return _iconViewInternal;
}
@@ -60,13 +60,26 @@
- (UILabel *)placeholderLabelInternal {
if (!_placeholderLabelInternal) {
_placeholderLabelInternal = [[UILabel alloc] init];
_placeholderLabelInternal.text = KBLocalized(@"Tap to paste their message");
// 稿
_placeholderLabelInternal.text = KBLocalized(@"Paste Ta's Words");
_placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
_placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
}
return _placeholderLabelInternal;
}
- (UIButton *)pasBtn{
if (!_pasBtn) {
_pasBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_pasBtn setImage:[UIImage imageNamed:@"kb_zt_icon"] forState:UIControlStateNormal];
[_pasBtn setTitle:KBLocalized(@" Paste Ta's Words") forState:UIControlStateNormal];
[_pasBtn setTitleColor:[UIColor colorWithHex:0x02BEAC] forState:UIControlStateNormal];
_pasBtn.titleLabel.font = [KBFont medium:13];
_pasBtn.backgroundColor = [UIColor whiteColor];
}
return _pasBtn;
}
#pragma mark - Expose
- (UIImageView *)iconView { return self.iconViewInternal; }