在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];
Run Code Online (Sandbox Code Playgroud)
更新到iOS7后,它停止工作 - 我的文本字段不再显示.更新代码的建议方法是什么?