Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unless I misunderstood your application structure, it seems like you're over complicating things with all those resignFirstResponder and becomeFirstResponder for UIAlertView dismiss.</p> <p>Essentially you got a UIAlertView with Username and Password fields yeah?</p> <p>Add a UIToolBar with a "Done" button that has a callback method like so:</p> <pre><code>// ------------------------------------------ // Setup keyboard done button as input // accessory view for your two fields // ------------------------------------------ UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; [toolBar setBarStyle:UIBarStyleBlackTranslucent]; UIButton *btnDone = [[UIButton alloc] initWithFrame:CGRectMake(230, 4, 66, 35)]; [btnDone setImage:[UIImage imageNamed:@"btnDoneOff.png"] forState:UIControlStateNormal]; [btnDone setImage:[UIImage imageNamed:@"btnDoneOn.png"] forState:UIControlStateHighlighted]; // ------------------------------------------ // Done button calls hideKeyboard method // when tapped, this is the only place you // need to call resign first responder // ------------------------------------------ [btnDone addTarget:self action:@selector(hideKeyboard) forControlEvents:UIControlEventTouchUpInside]; [toolBar addSubview:btnDone]; [btnDone release]; fldUsername.inputAccessoryView = toolBar; fldPassword.inputAccessoryView = toolBar; ... // ------------------------------------------ // Resigns first responder for the two fields // ------------------------------------------ -(void)hideKeyboard { [fldUsername resignFirstResponder]; [fldPassword resignFirstResponder]; } </code></pre> <p>Doing it like this, you can tap either the username field or the password field, the keyboard should not dismiss. When you're done entering username and password, pressing the "Done" button in your keyboard input accessory view will hide the keyboard without causing the keyboard to slide in and out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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