//文本输入框
//初始化
UITextField * inputUserName = [[UITextField alloc]init];
//位置
inputUserName.frame = CGRectMake(SCREEN_WIDTH * 0.3, SCREEN_HEIGHT * 0.4, 200, 50);
//指定文本内容颜色
[inputUserName setTextColor:[UIColor grayColor]];
//修改文本输入键盘样式
inputUserName.keyboardType = UIKeyboardTypeNumberPad;
//设置密码输入
inputUserName.secureTextEntry = YES;
//设置文本输入框提示内容
inputUserName.placeholder = @"请输入用户名";
//文本框透明度
inputUserName.alpha = 0.3;
//设置文本框样式
inputUserName.borderStyle = UITextBorderStyleRoundedRect;
//将控件添加到视图上
[self.view addSubview:inputUserName];