Created
October 26, 2012 09:11
-
-
Save lmauri/3957779 to your computer and use it in GitHub Desktop.
Force the dismiss of the keyboard on ios with monotouch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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