Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Latest commit

 

History

History

dismiss_the_keyboard

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
id title brief sdk
6468AABB-C81A-D68E-C315-0654E4234BC3
Dismiss the Keyboard
This recipe will show how to hide the keyboard.

Recipe

The keyboard does not automatically disappear when the return key is pressed and may cover or obscure certain parts of the UI. To dismiss the keyboard, send the UIResponder.ResignFirstResponder message to the text field that is currently the first responder.

  1. Provide ShouldReturn with a delegate or anonymous method that will call ResignFirstResponder on the field:
this.txtDefault.ShouldReturn += (textField) => {
    textField.ResignFirstResponder();
    return true;
};