//创建textfield
UITextField *textfield = [[UITextField alloc]init];
//设置边框
textfield.borderStyle = UITextBorderStyleRoundedRect;
//设置水印提示
textfield.placeholder = @"输入要显示的文字";
//设置输入框右边的一键删除(x号)
textfield.clearButtonMode = UITextFieldViewModeAlways;
//设置密码安全样式
textfield.secureTextEntry = YES;
//设置键盘样式
textfield.keyboaydType = UIKetboardTypeNumberPad;
//设置输入框一开始就有字
textfield.text = @"一开始就在输入框的字";
//设置输入的字体大小
textfield.font = [UIFont systemFontOfSize:你想设置的字体大小];
//自动换行
textfield.lineBreakMode = NSLineBreakByWordWrapping;
textfield.numberOfLines = 0;
//设置到当前控制器上
self.View addSubView:textfield;