IdAndPwdView.m
2.2 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// IdAndPwdView.m
// CNLiveUserSystemDemo
//
// Created by iOS on 16/9/14.
// Copyright © 2016年 zhulin. All rights reserved.
//
#import "IdAndPwdView.h"
@interface IdAndPwdView ()
@property (nonatomic, strong)UILabel *idLbl;
@property (nonatomic, strong)UILabel *pwdLbl;
@end
@implementation IdAndPwdView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
[self addSubview:self.idLbl];
[self addSubview:self.pwdLbl];
[self addSubview:self.idTF];
[self addSubview:self.pwdTF];
}
return self;
}
#pragma mark <GetMethod>
- (UILabel *)idLbl
{
if (!_idLbl) {
_idLbl = [[UILabel alloc] initWithFrame:CGRectMake(18, 0, 43, 57)];
_idLbl.textAlignment = NSTextAlignmentRight;
_idLbl.textColor = [UIColor blackColor];
_idLbl.font = [UIFont systemFontOfSize:17];
_idLbl.text = @"账号:";
}
return _idLbl;
}
- (UILabel *)pwdLbl
{
if (!_pwdLbl) {
_pwdLbl = [[UILabel alloc] initWithFrame:CGRectMake(18, 57, 43, 57)];
_pwdLbl.textAlignment = NSTextAlignmentRight;
_pwdLbl.textColor = [UIColor blackColor];
_pwdLbl.text = @"密码:";
_pwdLbl.font = [UIFont systemFontOfSize:17];
}
return _pwdLbl;
}
- (UITextField *)idTF
{
if (!_idTF) {
_idTF = [[UITextField alloc] initWithFrame:CGRectMake(78, 0, KScreenWidth - 88, 57)];
_idTF.font = [UIFont systemFontOfSize:17];
_idTF.placeholder = @"手机号码/Email";
_idTF.returnKeyType = UIReturnKeyDone;
}
return _idTF;
}
- (UITextField *)pwdTF
{
if (!_pwdTF) {
_pwdTF = [[UITextField alloc] initWithFrame:CGRectMake(78, 57, KScreenWidth - 88, 57)];
_pwdTF.font = [UIFont systemFontOfSize:17];
_pwdTF.secureTextEntry = YES;
_pwdTF.placeholder = @"6-20位字母或数字";
_pwdTF.returnKeyType = UIReturnKeyDone;
}
return _pwdTF;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end