由於某些原因,即使我禁用自動上限和自動更正我的UITextField,它仍然會大寫輸入的第一個字母。iPhone:禁用UITextField上的自動上限/自動更正
下面是代碼:
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;
}
}
見截圖: alt text http://grab.by/39WE
哈!我有相反的問題。我正確禁用了自動更正 - 但將自動大寫設置爲FALSE - D哦! – philsquared 2011-10-21 20:54:06