Skip to content

Instantly share code, notes, and snippets.

@lmauri
Created October 26, 2012 09:11
Show Gist options
  • Save lmauri/3957779 to your computer and use it in GitHub Desktop.
Save lmauri/3957779 to your computer and use it in GitHub Desktop.
Force the dismiss of the keyboard on ios with monotouch
public static void DismissKeyboard(UIView view)
{
if (AppManager.IsKeyboardVisible)
{
var text = new UITextField(RectangleF.Empty);
view.AddSubview(text);
text.BecomeFirstResponder();
text.ResignFirstResponder();
text.RemoveFromSuperview();
text.Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment