public override void TouchesEnded(NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); // if they tap somewhere outside of the text fields, // hide the keyboard UserNameField.ResignFirstResponder( ); PasswordField.ResignFirstResponder( ); }