Posted By

espinallab on 05/04/11


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

kolya
shalomfriss
cnathan
dvel


Adding TextField to UIAlertView


 / Published in: Objective C
 

  1. UIAlertView* myAlert = [[UIAlertView alloc] initWithTitle:@"Enter Name" message:@"Enter Name\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
  2.  
  3. [myAlert addTextFieldWithValue:@"" label:@"name-age"];
  4. myTextField = [myAlert textFieldAtIndex:0];
  5. myTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
  6. myTextField.keyboardType = UIKeyboardTypeAlphabet;
  7. myTextField.keyboardAppearance = UIKeyboardAppearanceAlert;
  8. myTextField.autocapitalizationType = UITextAutocapitalizationTypeWords;
  9. myTextField.autocorrectionType = UITextAutocapitalizationTypeNone;
  10. myTextField.textAlignment = UITextAlignmentCenter;
  11.  
  12. [myAlert show];
  13. [myAlert release];

Report this snippet  

You need to login to post a comment.