49 lines
1.7 KiB
Objective-C
49 lines
1.7 KiB
Objective-C
//
|
|
// PIInputScrollingView.m
|
|
// YuMi
|
|
//
|
|
// Created by duoban on 2023/10/19.
|
|
//
|
|
|
|
#import "PIInputScrollingView.h"
|
|
@interface PIInputScrollingView()
|
|
@property(nonatomic,strong) MSBaseTextField *pi_textField;
|
|
@end
|
|
@implementation PIInputScrollingView
|
|
|
|
-(instancetype)initWithFrame:(CGRect)frame{
|
|
self = [super initWithFrame:frame];
|
|
if(self){
|
|
[self installUI];
|
|
[self installConstraints];
|
|
}
|
|
return self;
|
|
}
|
|
-(void)installUI{
|
|
self.backgroundColor = UIColorFromRGB(0xF8F8FA);
|
|
[self setCornerWithLeftTopCorner:kGetScaleWidth(8) rightTopCorner:kGetScaleWidth(8) bottomLeftCorner:kGetScaleWidth(8) bottomRightCorner:kGetScaleWidth(8) size:CGSizeMake(kGetScaleWidth(327), kGetScaleWidth(52))];
|
|
[self addSubview:self.pi_textField];
|
|
}
|
|
-(void)installConstraints{
|
|
[self.pi_textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(10));
|
|
make.bottom.top.equalTo(self);
|
|
}];
|
|
}
|
|
- (NSString *)pi_scrolling{
|
|
return self.pi_textField.text;
|
|
}
|
|
#pragma mark - 懒加载
|
|
- (MSBaseTextField *)pi_textField{
|
|
if(!_pi_textField){
|
|
_pi_textField = [[MSBaseTextField alloc]init];
|
|
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:YMLocalizedString(@"PIInputScrollingView0") attributes:@{NSFontAttributeName:kFontRegular(16),NSForegroundColorAttributeName:UIColorFromRGB(0xB3B3C3)}];
|
|
_pi_textField.attributedPlaceholder = placeholder;
|
|
_pi_textField.textColor = UIColorFromRGB(0x322F4D);
|
|
_pi_textField.font = kFontRegular(16);
|
|
_pi_textField.textAlignment = NSTextAlignmentCenter;
|
|
}
|
|
return _pi_textField;
|
|
}
|
|
@end
|