2015-02-24 4 views
0

Мне нужно поставить 5 UITextField в UIAlertView. Я использую этот проект: https://www.cocoacontrols.com/controls/aralertcontrollerДобавить несколько UITextfield в UIAlertview

Это мой код:

ARAlertController *alert = [ARAlertController alertControllerWithTitle:@"My Alert" message:@"This is an alert." preferredStyle:ARAlertControllerStyleAlert]; 
ARAlertAction* defaultAction = [ARAlertAction actionWithTitle:@"OK" style:ARAlertActionStyleDefault handler:^(ARAlertAction * action) {}]; 



[alert addAction:defaultAction]; 
[alert presentInViewController:self animated:YES completion:nil]; 

Может кто-то помочь мне осуществить в моей ?

Благодаря

ответ

0

Вы должны использовать что-то вроде:

ARAlertController *alert = [ARAlertController alertControllerWithTitle:@"My Alert" message:@"This is an alert." preferredStyle:ARAlertControllerStyleAlert]; 
ARAlertAction* defaultAction = [ARAlertAction actionWithTitle:@"OK" style:ARAlertActionStyleDefault handler:^(ARAlertAction * action) {}]; 
[alert addAction:defaultAction]; 

[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { 
    textField.placeholder = @"First"; 
}]; 
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { 
    textField.placeholder = @"second"; 
}]; 
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { 
    textField.placeholder = @"third"; 
}]; 
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { 
    textField.placeholder = @"fourth"; 
}]; 
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { 
    textField.placeholder = @"fifth"; 
}]; 

[alert presentInViewController:self animated:YES completion:nil]; 

Good Лукой.

+0

Хорошо, спасибо @benhi Я пробовал ... – benhi

Смежные вопросы