在 iOS7 之前,我可以使用此代码UITextField
向我添加一个(文本输入字段) 。UIAlertView
UITextField *txtNewPassword = [[UITextField alloc] initWithFrame:secondTextFldRect];
txtNewPassword.delegate = self;
txtNewPassword.text = @"";
txtNewPassword.clearButtonMode = UITextFieldViewModeWhileEditing;
txtNewPassword.borderStyle = UITextBorderStyleRoundedRect;
txtNewPassword.autocapitalizationType = UITextAutocapitalizationTypeNone;
txtNewPassword.tag = kNewPasswordTxtFldTag;
[txtNewPassword setBackgroundColor:[UIColor whiteColor]];
[txtNewPassword setKeyboardAppearance:UIKeyboardAppearanceAlert];
[txtNewPassword setAutocorrectionType:UITextAutocorrectionTypeNo];
[txtNewPassword setPlaceholder:@"New password"];
[txtNewPassword setTextAlignment:UITextAlignmentLeft];
[txtNewPassword setSecureTextEntry:YES];
[alert addSubview:txtNewPassword];
[txtNewPassword release];
更新到 iOS7 后它停止工作 - 我的文本字段不再显示。更新我的代码的建议方法是什么?