// // HDLEZInputView.m // EZSDK // // Created by 陈启扬 on 2023/3/13. // #import "HDLEZInputView.h" @implementation HDLEZInputView -(instancetype)init{ self = [super init]; if (self) { [self initUI]; } return self; } -(void)initUI{ self.backgroundColor = HDLEZ_COLOR_VIEW_BACKGROUND; //输入view UIView *inputV=[[UIView alloc] init]; [self addSubview:inputV]; [inputV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.left.right.equalTo(self); make.height.mas_equalTo(50); }]; inputV.backgroundColor=HDLEZ_COLOR_VIEW_FOREGROUND; //输入框 _inputTextF=[[UITextField alloc] init]; [inputV addSubview:_inputTextF]; [_inputTextF mas_makeConstraints:^(MASConstraintMaker *make) { make.top.bottom.equalTo(inputV); make.left.equalTo(inputV).offset(16); make.right.equalTo(inputV).offset(-16); }]; _inputTextF.placeholder=HDLEZLocallizedString(@"device_temp_please_input"); _inputTextF.textColor=HDLEZ_COLOR_TEXT_TITLE_GRAY; _inputTextF.font=HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_16); //描述lable _describeL=[[UILabel alloc] init]; [self addSubview:_describeL]; [_describeL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(inputV.mas_bottom).offset(10); make.left.equalTo(inputV).offset(16); make.right.equalTo(inputV).offset(-16); make.height.mas_equalTo(30); }]; _describeL.numberOfLines=2; _describeL.adjustsFontSizeToFitWidth=YES; _describeL.textColor=HDLEZ_COLOR_TEXT_TITLE_GRAY; _describeL.font=HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_14); } /*设置输入类型值 */ -(void)setInputType:(HDLEZInputType)inputType{ _inputType=inputType; if (inputType==HDLEZInputType_UseCount) {//为输入使用次数 _inputTextF.keyboardType=UIKeyboardTypeASCIICapableNumberPad; _describeL.text=HDLEZLocallizedString(@"device_temp_input_use_count_describe"); } } @end