Adding an UITextField to an UIAlertView in iPhone / iOS application
As we all know, UIAlertView is subclassed from UIView, its possible to add sub views to the alert view. Today, we will try to add an text field to UIAlertView. The code is attached below. UIAlertView *alert = [[ UIAlertView alloc ] initWithTitle : @"See the text field below" message : @"this gets covered!\n" delegate : self cancelButtonTitle : @"Dismiss" otherButtonTitles : @"OK" , nil ]; alert. tag = 1 000 ; UITextField *_textField = [[ UITextField alloc ] initWithFrame : CGRectMake ( 12 , 45 , 260 , 25 )]; [_textField setPlaceholder : @"Place holder text" ]; _textField. tag = 1 00 ; _textField. clearButtonMode = UITextFieldViewModeWhileEditing ; [_textField setBackgroundColor :[ UIColor whiteColor ]]; [_textField becomeFirstResponder ]; [alert a...