In an iPhone app, I am having a UITextField
which needs input as numerics, so I am passing the Keyboard type as UIKeyboardTypeNumberPad
. It works but there is no return or Done button, so how can I hide the keyboard.
Code for reference is:
textDriverAge.delegate=self;
textDriverAge.keyboardType=UIKeyboardTypeNumberPad;
textDriverAge.clearButtonMode = UITextFieldViewModeWhileEditing;
[textDriverAge setReturnKeyType:UIReturnKeyDone];// UIReturnKeyNext];
textDriverAge.enablesReturnKeyAutomatically=TRUE;
I have handled the UITextfield
events like:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
if(textDriverAge == textField)
{
[textDriverAge resignFirstResponder];
//[tglDropInDropOff becomeFirstResponder];
}
}
Guide me how to hide the keyboard.
you can use two types
Touch Method
.use this link iOS dismissing keyboard, UILabel malfunction
in another choice add the
UIToolbar
in your view Controller.