ユーザーがテキスト入力を入力できるポップアップアラートビューを作成したいと思います。以下のコードを試しました。
それは機能しますが、UITextViewのような大きなテキスト領域が必要です。ただし、より大きなフレーム領域で UITextView を使用した場合。UIAlertView 領域全体をカバーします。
大きなテキスト領域 (UITextView) を使用してポップアップ テキスト入力を作成する方法の例はありますか。
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Preset Saving..." message:@"Describe the Preset\n\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
UITextField *textField;
textField = [[UITextField alloc] init];
[textField setBackgroundColor:[UIColor whiteColor]];
textField.delegate = self;
textField.borderStyle = UITextBorderStyleLine;
textField.frame = CGRectMake(15, 75, 255, 30);
textField.font = [UIFont fontWithName:@"ArialMT" size:20];
textField.placeholder = @"Preset Name";
textField.textAlignment = UITextAlignmentCenter;
textField.keyboardAppearance = UIKeyboardAppearanceAlert;
[textField becomeFirstResponder];
[alert addSubview:textField];