如何在iOS 7中向UIAlertView添加多个UITextField?

Lun*_*una 3 iphone ios

我需要在iOS 7的UIAlertView上添加Multiple UITextField吗?

 myAlertView = [[UIAlertView alloc] initWithTitle:@"Enter Your Detail" message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Register",nil];
txtEmail = [[UITextField alloc] initWithFrame:CGRectMake(30, 40, 220, 25)];
txtEmail.placeholder = @"email address";
txtFirstName = [[UITextField alloc] initWithFrame:CGRectMake(30, 70, 220, 25)];
txtFirstName.placeholder = @"first Name";
txtSurname = [[UITextField alloc] initWithFrame:CGRectMake(30, 100, 220, 25)];
txtSurname.placeholder = @"surname";
[myAlertView addSubview:txtEmail];
[myAlertView addSubview:txtFirstName];
[myAlertView addSubview:txtSurname];

[myAlertView show];
Run Code Online (Sandbox Code Playgroud)

在IOS 6中没问题,但在IOS 7中它没有显示UITextField

nul*_*ull 7

你不能再这样做了,iOS7中已经没有addSubviewUIAlertView.

以下是很好的选择:

IOS-定制alertview

MZFormSheetController