2025-10-28 14:30:03 +08:00
|
|
|
//
|
|
|
|
|
// KBFunctionPasteView.m
|
|
|
|
|
// CustomKeyboard
|
|
|
|
|
//
|
|
|
|
|
// Created by Mac on 2025/10/28.
|
|
|
|
|
// 粘贴View
|
|
|
|
|
|
|
|
|
|
#import "KBFunctionPasteView.h"
|
|
|
|
|
#import "Masonry.h"
|
2025-11-26 21:16:56 +08:00
|
|
|
#import "KBFont.h"
|
2025-10-28 14:30:03 +08:00
|
|
|
|
|
|
|
|
@interface KBFunctionPasteView ()
|
2025-11-28 16:19:06 +08:00
|
|
|
//@property (nonatomic, strong) UIImageView *iconViewInternal;
|
|
|
|
|
//@property (nonatomic, strong) UILabel *placeholderLabelInternal;
|
2025-11-26 21:16:56 +08:00
|
|
|
|
2025-10-28 14:30:03 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation KBFunctionPasteView
|
|
|
|
|
|
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
|
|
|
if (self = [super initWithFrame:frame]) {
|
|
|
|
|
// 白底圆角容器
|
|
|
|
|
self.backgroundColor = [UIColor colorWithWhite:1 alpha:0.95];
|
|
|
|
|
self.layer.cornerRadius = 12.0;
|
|
|
|
|
self.layer.masksToBounds = YES;
|
|
|
|
|
|
2025-11-26 21:16:56 +08:00
|
|
|
// [self addSubview:self.iconViewInternal];
|
|
|
|
|
// [self addSubview:self.placeholderLabelInternal];
|
|
|
|
|
[self addSubview:self.pasBtn];
|
|
|
|
|
[self.pasBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.edges.equalTo(self);
|
2025-10-28 14:30:03 +08:00
|
|
|
}];
|
2025-11-26 21:16:56 +08:00
|
|
|
|
|
|
|
|
// [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);
|
|
|
|
|
// }];
|
|
|
|
|
|
2025-10-28 14:30:03 +08:00
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Lazy
|
2025-11-28 16:19:06 +08:00
|
|
|
//
|
|
|
|
|
//- (UIImageView *)iconViewInternal {
|
|
|
|
|
// if (!_iconViewInternal) {
|
|
|
|
|
// _iconViewInternal = [[UIImageView alloc] init];
|
|
|
|
|
// _iconViewInternal.image = [UIImage imageNamed:@"kb_zt_icon"];
|
|
|
|
|
// }
|
|
|
|
|
// return _iconViewInternal;
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//- (UILabel *)placeholderLabelInternal {
|
|
|
|
|
// if (!_placeholderLabelInternal) {
|
|
|
|
|
// _placeholderLabelInternal = [[UILabel alloc] init];
|
|
|
|
|
// // 文案改为更贴近设计稿
|
|
|
|
|
// _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;
|
|
|
|
|
//}
|
2025-10-28 14:30:03 +08:00
|
|
|
|
2025-11-26 21:16:56 +08:00
|
|
|
- (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;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-28 14:30:03 +08:00
|
|
|
#pragma mark - Expose
|
|
|
|
|
|
2025-11-28 16:19:06 +08:00
|
|
|
//- (UIImageView *)iconView { return self.iconViewInternal; }
|
|
|
|
|
//- (UILabel *)placeholderLabel { return self.placeholderLabelInternal; }
|
2025-10-28 14:30:03 +08:00
|
|
|
|
|
|
|
|
@end
|