萤石云 iOSSDK,移植跨平台相关工程
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
//  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