Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Just use this way it works for me</p> <p>First set the the UITextFieldDelegate,UIActionSheetDelegate in your class .h file</p> <p>#define TEXT_FIELD_TAG 9999</p> <p>#define ACTION_SHEET_TAG 8888</p> <pre><code>-(IBAction)ForgotPassword:(id)sender{ UIActionsheet *actFollowUp = [[UIActionSheet alloc] initWithTitle:@"Please Enter Email" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil]; actFollowUp.tag=ACTION_SHEET_TAG; textFieldTime = [[UITextField alloc] initWithFrame:CGRectMake(60.f,320.f, 200.f, 30.f)]; [textFieldTime setBackgroundColor:[UIColor whiteColor]]; textFieldTime.delegate= self; [textFieldTime setKeyboardType:UIKeyboardTypeAlphabet]; textFieldTime.keyboardAppearance= UIKeyboardAppearanceAlert; textFieldTime.tag=TEXT_FIELD_TAG; [actFollowUp addSubview:textFieldTime]; UIWindow* appWindow = [UIApplication sharedApplication].keyWindow; [actFollowUp showInView:appWindow]; [actFollowUp setFrame:CGRectMake(0.0,200.0, 320.0, 200.0)]; [self performSelector: @selector(acceptInput:) withObject: actFollowUp]; </code></pre> <p>}</p> <pre><code> -(void)acceptInput: (UIActionSheet*)actionSheet { UITextField* textField = (UITextField*)[actionSheet viewWithTag:TEXT_FIELD_TAG]; UIWindow* appWindow = [UIApplication sharedApplication].keyWindow; CGRect frame = textField.frame; [appWindow insertSubview:textField aboveSubview:actionSheet]; frame.origin.y += 60.0; // move text field to same position as on action sheet textField.frame = frame; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload