/ Published in: iPhone
Oculta el teclado del iPhone cuando se toca en otro lado de la pantalla que no sea el campo de texto actual.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Esta funcion es para que cuando el Usuario toque fuera de // un campo de texto, desaparezca el teclado UITouch *touch = [[event allTouches] anyObject]; // Listo los campos de texto if ([txtUsuario isFirstResponder] && [touch view] != txtUsuario) { [txtUsuario resignFirstResponder]; } if ([txtPassword isFirstResponder] && [touch view] != txtPassword) { [txtPassword resignFirstResponder]; } [super touchesBegan:touches withEvent:event]; }