Jigar Joshi
Jigar Joshi

Reputation: 240860

How to dismiss number pad on return key

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

it is not working....

Upvotes: 2

Views: 3313

Answers (1)

Frank Shearar
Frank Shearar

Reputation: 17132

This answer demonstrates that the delegate decides whether or not to dismiss the keypad.

If you want to dismiss the keypad, textFieldShouldReturn: must return NO:

-(BOOL) textFieldShouldReturn:(UITextField*) theTextField{
    [theTextField resignFirstResponder];
    return NO;
}

Upvotes: 3

Related Questions