views:

119

answers:

0

Hi,

i`m fighting my way to dismiss a keyboard appearance via done-button.

the code is, to make it short:

UITextField *name  = [[UITextField alloc] initWithFrame:CGRectMake(160, 0, 200, 50)];
name.delegate      = self;
name.returnKeyType = UIReturnKeyDone;

as well as:

- (BOOL) textFieldShouldReturn:(UITextField *) textField 
{ 
    // return [textField resignFirstResponder];
    [textField resignFirstResponder];
    return YES;
}

and what i get is:

a textfield, on tap i get a keyboard with Done-Button, just as i wanted it to have.

But now, the weird! clicking "Done" seems to dismiss the cursor, i cannot type in anymore, but the keyboard does not leave the view. Clicking the "please get the hell out of my screen" button on the lower right (iPad) will close the keyboard.

Seems like i must have overseen something. However, i googled a lot, but cannot find out whats wrong.

i NSLog-ged the textFueldShouldReturn method, its called with the proper textfield.