1.设置占位符
textField.placeholder = @“”;
2.设置暗文输入
textField.secureTextEntry = YES;
3.设置键盘类型 textField.keyboardType = 1; 4.设置边框类型
textField.boardStyle = UITextBorderStyleRoundedRect;
5.设置右下角return键
textField.returnKeyType = UIReturnKeyGo; UIReturnKeyDefault, UIReturnKeyGo, UIReturnKeyGoogle, UIReturnKeyJoin, UIReturnKeyNext, UIReturnKeyRoute, UIReturnKeySearch, UIReturnKeySend, UIReturnKeyYahoo, UIReturnKeyDone, UIReturnKeyEmergencyCall,
6.设置清除图标
textField.clearButtonMode = 1; UITextFieldViewModeNever, UITextFieldViewModeWhileEditing, UITextFieldViewModeUnlessEditing, UITextFieldViewModeAlways
7.回收键盘
[textField resignFirstResponder ];
8.回收键盘 (点击空白处回收)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.textField resignFirstResponder]; }