Adding TextField to UIAlertView


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.