1

I am having trouble to dismiss keyboard from UIPopover. I have text field in popover form when I run this ResignFirstResponder() function nothing happening. Not sure why any idea. it is happening only when I run it from popover.

Is it because of it overlay and object. Need help?

Here some example of my code: Here I am calling popover;

            if (this.CustomerID != 0) {
                var content = new BillingAddressViewController (this, this.CustomerBillingAddress);
                content.CustomerID = this.CustomerID;
                content.rootcontroller = this;
                DetailViewPopover = new UIPopoverController (content);
                DetailViewPopover.PopoverContentSize = new SizeF (300, 200);
                DetailViewPopover.PresentFromRect (this.customerBillingAddressCell.Frame, View, UIPopoverArrowDirection.Any, true);
            } else {
                var x = new UIAlertView ("Notifcation Message", "Please choose customer to proceed with Billing Address", null, "OK");
                x.Show ();
            }

        };

Inside of popover content class I am calling

this.billingTextView.ResignFirstResponder();

on button trigger;

Akrambek
  • 307
  • 4
  • 12

1 Answers1

0

in your DissmisskeyBoard method use the following code.

[self.view endEditing:YES];

hope it will help you out.

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self.view endEditing:YES];
return YES;
}
Siba Prasad Hota
  • 4,779
  • 1
  • 20
  • 40