0

In my UIViewController <GLKViewDelegate> in need to make a simple text input when selecting a object.

Is there in UIKit a simple multiline text input popup ready to use ?

I already found UIAlertView with alertViewStyle=UIAlertViewStylePlainTextInput but it's only a simple line input.

thx

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134

2 Answers2

3

If you mean is there an equivalent of the text input UIAlertView with a UITextView rather than a UITextField, the answer is no.

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
  • [Click here Ashley](http://stackoverflow.com/questions/3410372/iphone-sdk-adding-a-textfield-to-uialertview-does-not-work-in-ios-4) – Filoo May 31 '12 at 11:30
  • Absolutely you can roll your own, but the question was "**Is there in UIKit a simple multiline text input popup ready to use**", so the answer is no. – Ashley Mills May 31 '12 at 12:31
0

Your question is not very clear. but I think UIActionSheet is what you need.

Edit

You can try this out

Set this in un .h file the the delegate like this

@interface NameOfYourClass : UIViewController <UIActionSheetDelegate> 

And add this code in un .m File

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Action Sheet" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Other Button 1", @"Other Button 2", nil];

    actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;

    [actionSheet showInView:self.view];

Edit2

So here's what to do to add a textfield to your allertview

UIAlertView *newAlert =[[UIAlertView alloc] initWithTitle:@"ADD item" message:@"Put it blank textfield will cover this" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];

    UITextField *newTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
    newTextField.text=@"";
    [newTextField setBackgroundColor:[UIColor whiteColor]];
    [newTextField setKeyboardAppearance:UIKeyboardAppearanceAlert];
    [newTextField setAutocorrectionType:UITextAutocorrectionTypeNo];

    [newTextField setTextAlignment:UITextAlignmentCenter];
    [newAlert addSubview:newTextField];

    [newAlert show];
Filoo
  • 282
  • 1
  • 14
  • edited, you have to set the delegate of the actionSheet in your .h class – Filoo May 31 '12 at 11:34
  • Ok I finally figured out what you need! the only way to have a alertview with more text fields is to create a custom alertview on the base of UIView – Filoo May 31 '12 at 13:00