iOS UITextField使用
2017-04-11 15:37
120 查看
- (UITextField *)phoneTextField
{
if (!_phoneTextField) {
_phoneTextField = [[UITextField
alloc]init];
[_phoneTextField
setBorderStyle:UITextBorderStyleNone];
[_phoneTextField
setPlaceholder:@"请输入手机号"];
[_phoneTextField
setTextColor:RGB(51,
51, 51)];
[_phoneTextField
setFont:[UIFont
systemFontOfSize:15]];
[_phoneTextField
setKeyboardType:UIKeyboardTypePhonePad];
[_phoneTextField
setClearButtonMode:UITextFieldViewModeWhileEditing];
[_phoneTextField
addTarget:self
action:@selector(textFieldDidChange:)
forControlEvents:UIControlEventEditingChanged];
}
return
_phoneTextField;
}
[self.view
addSubview:self.phoneTextField];
_phoneTextField.frame =
CGRectMake(50,
50, kScreenWidth,
45);
{
if (!_phoneTextField) {
_phoneTextField = [[UITextField
alloc]init];
[_phoneTextField
setBorderStyle:UITextBorderStyleNone];
[_phoneTextField
setPlaceholder:@"请输入手机号"];
[_phoneTextField
setTextColor:RGB(51,
51, 51)];
[_phoneTextField
setFont:[UIFont
systemFontOfSize:15]];
[_phoneTextField
setKeyboardType:UIKeyboardTypePhonePad];
[_phoneTextField
setClearButtonMode:UITextFieldViewModeWhileEditing];
[_phoneTextField
addTarget:self
action:@selector(textFieldDidChange:)
forControlEvents:UIControlEventEditingChanged];
}
return
_phoneTextField;
}
[self.view
addSubview:self.phoneTextField];
_phoneTextField.frame =
CGRectMake(50,
50, kScreenWidth,
45);
相关文章推荐
- iOS中UITextField 使用解析
- IOS 使用UITextField自动格式化银行卡号
- iOS开发之五:常用控件--UITextField的使用
- IOS 使用UITextField自动格式化银行卡号
- IOS 使用UITextField自动格式化银行卡号
- IOS UITextField使用
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用全面解析
- IOS使用视图控制器和视图(九) UITextField属性
- iOS 使用UITextField隐藏键盘
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用全面解析
- IOS 学习笔记(6) 控件 文本域(UITextField)的使用方法
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用解析
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用全面解析
- iOS中UITextField 使用全面解析
- IOS UITextField使用总结