vibracion tipo teclado tamaƱo para letra descargar color cambiar aumentar aplicacion activar ios objective-c keyboard iphone-softkeyboard

ios - tipo - teclado iphone 7



ocultando ios del teclado (4)

Prueba esto:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self view] endEditing:YES]; }

Esta pregunta ya tiene una respuesta aquí:

Tengo algunas entradas de texto y puedo ocultar el teclado cada vez que toco el fondo, pero solo cuando he estado ingresando en el primer cuadro de texto con el nombre textField1. Ahora este código debería ser simple pero parece que no lo consigo.

-(IBAction)backgroundTouched:(id)sender { [textField1 resignFirstResponder]; [buildLength resignFirstResponder]; [buildWidth resignFirstResponder]; [ridgeWidth resignFirstResponder]; [rafterWidth resignFirstResponder]; [hipWidth resignFirstResponder]; [eaveOverhang resignFirstResponder]; [spacing resignFirstResponder]; }


Puede probar el método UITouch y, en este caso, establezca su objeto de campo de texto y llame a resignFirstResponder cada vez que toque la pantalla, el teclado renunciará, espero que esto le resignFirstResponder .

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [currentSelectedTextField resignFirstResponder]; }


Si desea ocultar el teclado cuando toca un botón y tiene más de un UITextFields en su view , debe usar:

[self.view endEditing:YES];

Toque en cualquier lugar de la vista, y el teclado desaparecerá.


También puede iterar a través de una serie de vistas (como las subvistas de su UIView) y renunciar manualmente al teclado, esto es bueno si no desea renunciar a TODAS las subvistas dentro de su UIView principal.

- (void)viewDidLoad { self.view.userInteractionEnabled = TRUE; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ //Iterate through your subviews, or some other custom array of views for (UIView *view in self.view.subviews) [view resignFirstResponder]; }