2
Я хотел бы разрешить пользователям вводить несколько строк текста. Я использую UIAlertController для этого. Ниже приведен мой код, который я использую.Невозможно ввести текстовое представление в UIAlertController
UIAlertController * alert= [UIAlertController
alertControllerWithTitle:@"Remarks"
message:@"Please enter the remarks:"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
UITextField *email = alert.textFields.firstObject;
NSLog(@"%@",email.text);
if (![email.text isEqualToString:@""])
{
}
else
{
[self showMessage:@"Remark is mandatory" withTitle:@"Remarks!"];
}
}];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:ok];
[alert addAction:cancel];
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"Enter the remarks";
}];
[self presentViewController:alert animated:YES completion:nil];
Проблема заключается в том,
- текстовое поле внутри контроллера UIAlertController оленья кожа многопроцессорной поддержки, как тексты. Как заменить текстовое поле на textview?
- Есть ли другая альтернатива, через которую я могу получить ввод через текстовое представление, реализуя всплывающее окно, как в UIAlertController?
Посмотрите на это сообщение http://stackoverflow.com/questions/34420080/multiline-editable-text-uitextview-inside-uialertcontroller –
я проверил его, но им, используя Objective C и не скор – Roger