我需要在iOS 7的UIAlertView上添加多個UITextField?如何將多個UITextFields添加到iOS 7中的UIAlertView?
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];
在iOS 6中沒有問題,但在IOS 7中沒有顯示的UITextField
只是作爲魅力http://stackoverflow.com/a/25175989/2459296 – Salim