Translate

martes, 12 de febrero de 2013

Hidding a numeric keyboard in IOS

With the standart keyboard we have a "Done" button, so once the user click over this "Done" button the action "Did en on exit" is called. Then we can use the following piece of code to close the keyboard just when the users touch over this "Done" button:

       [self.theEditOutlet resignFirstResponder ]

But with the other numerical types of keyboardas this button doesn´t exist. In this case we could add a toollbar including a custom "Done" button, or more easilly using the method "touchesBegan".

This method must be implemented in the .m ViewController file and must be as follows:

-(void) touchesBegan:(NSSet  *)touches withEvent:(UIEvent *)event
{
    [self.theEditOutlet resignFirstresponder ]
}

No hay comentarios: