iPhone: Issue disabling Auto-Cap/autocorrect on a UITextField
Posted
by phil swenson
on Stack Overflow
See other posts from Stack Overflow
or by phil swenson
Published on 2010-03-19T03:34:02Z
Indexed on
2010/03/19
3:41 UTC
Read the original article
Hit count: 620
For some reason, even though I disable the auto-cap and auto-correct of my UITextField, it's still capitalizing the first letter of my input.
Here is the code:
UITextField* textField = [[[UITextField alloc] initWithFrame:CGRectMake(90.0, 10.0, 213.0, 25.0)] autorelease];
[textField setClearButtonMode:UITextFieldViewModeWhileEditing];
textField.returnKeyType = UIReturnKeyGo;
textField.autocorrectionType = FALSE;
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
textField.delegate = self;
if (inputFieldType == Email) {
label.text = @"Email:";
textField.keyboardType = UIKeyboardTypeEmailAddress;
emailTextField = textField;
textField.placeholder = @"Email Address";
} else { // password
textField.secureTextEntry = TRUE;
label.text = @"Password:";
if (inputFieldType == Password){
textField.placeholder = @"Password";
passwordTextField = textField;
}
if (inputFieldType == ConfirmPassword){
textField.placeholder = @"Confirm Password";
confirmPasswordTextField = textField;
}
}
See screenshot:
© Stack Overflow or respective owner