您的位置:首页 > 产品设计 > UI/UE

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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: