Frage

I am finding it quite impossible to resign the first responder in my Modal View that is a Navigation Controller.

I have a search bar that I use to search through a tableview. I need to have it so that when I click on a cell, or navigate from the pushed view the keyboard disappears. I have tried calling

[_searchbar resignFirstResponder];

and doing a similar call for every view and subview in the modal view. Nothing causes the keyboard to hide.

Any ideas?

I've also tried using delegate methods, such as searchBarShouldEndEditing and also, calling the method on NavigationItemShouldPop.

I am at a complete loss.

War es hilfreich?

Lösung

Not sure if you have solved this already but this thread holds the key:

iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet

For your particular case (same as mine) with the navigation controller within the modal form sheet look at the third answer.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top