How to hide keyboard in Xamarin.iOS on press of navigationBar

VenkataSwamyVenkataSwamy INMember ✭✭✭

Hi,

I am facing the above problem Please help me on that, Thanks in advance
The below code is working for View Tap but I want to do hide Keyboard on NavigationBar Click also

            var viewTap = new UITapGestureRecognizer(() => {
            View.EndEditing(true);
        });
       viewTap.CancelsTouchesInView = false;
      View.AddGestureRecognizer(viewTap);

Answers

  • TedRogersTedRogers USMember ✭✭✭✭

    @BalaRaju the usually way to do this is the track what UITextField is active using the UITextFieldDelegate or event handlers and listen to TextFieldDidBeginEditing and TextFieldDidEndEditing to store and clear the active text field. Then just call ResignFirstResponder() on your active text field if you have one.

Sign In or Register to comment.