RegistBasicInformationView.m
2.04 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
//
// RegistBasicInformationView.m
// CNLiveUserSystemDemo
//
// Created by iOS on 16/9/14.
// Copyright © 2016年 zhulin. All rights reserved.
//
#import "RegistBasicInformationView.h"
static BOOL isPhone;
@implementation RegistBasicInformationView
- (instancetype)initWithFrame:(CGRect)frame hasPwd:(BOOL)pwd isPhone:(BOOL)phone
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
if (phone) {
isPhone = YES;
} else {
isPhone = NO;
}
[self addSubview:self.phoneTF];
[self addSubview:self.verificationTF];
if (pwd) {
[self addSubview:self.setPwdTF];
}
}
return self;
}
#pragma mark <GetMethod>
- (UITextField *)phoneTF
{
if (!_phoneTF) {
_phoneTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 0, KScreenWidth - 110, 57)];
if (isPhone) {
_phoneTF.placeholder = @"请输入手机号";
_phoneTF.keyboardType = UIKeyboardTypeNumberPad;
} else {
_phoneTF.placeholder = @"请输入手机号或邮箱";
}
_phoneTF.font = [UIFont systemFontOfSize:17];
_phoneTF.clearButtonMode = UITextFieldViewModeWhileEditing;
}
return _phoneTF;
}
- (UITextField *)verificationTF
{
if (!_verificationTF) {
_verificationTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 57, KScreenWidth - 20, 57)];
_verificationTF.placeholder = @"请输入您收到的验证码";
_verificationTF.keyboardType = UIKeyboardTypeNumberPad;
_verificationTF.font = [UIFont systemFontOfSize:17];
}
return _verificationTF;
}
- (UITextField *)setPwdTF
{
if (!_setPwdTF) {
_setPwdTF = [[UITextField alloc] initWithFrame:CGRectMake(10, 114, KScreenWidth - 20, 57)];
_setPwdTF.placeholder = @"请设置密码:6-20位字母或数字";
_setPwdTF.font = [UIFont systemFontOfSize:17];
_setPwdTF.secureTextEntry = YES;
}
return _setPwdTF;
}
@end