2016-06-21 8 views
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]; 

問題は、テキストなどのマルチをサポートするdoesntのUIAlertControllerコントローラ内

  1. テキストフィールドです。テキストフィールドをテキストビューに置き換えるにはどうすればよいですか?
  2. UIAlertControllerのようにポップアップを実装することによって、textview経由で入力を得ることができる他の方法はありますか?
+0

この記事を見てくださいhttp://stackoverflow.com/questions/34420080/multiline-editable-text-uitextview-inside-uialertcontroller –

+0

私はそれをチェックするが、イム迅速客観Cを使用していません – Roger

答えて

関連する問題