UISearchBarController not hide after returned button called

73 Views Asked by At

I have a viewController with a tableViewController inside. My problem is that the SearchBar does not disappear when I press the return button so what does it when I press the cancel button. Have you an idea of the problem?

Thanks

3

There are 3 best solutions below

0
On

If you want to dismiss the search interface (like search bar and "cancel" button). The next code does it:

[self.searchDisplayController setActive:NO animated:YES];
0
On

If you use an UISearchDisplayController, try this

[self.searchDisplayController setActive:NO animated:YES];

when you call the action make by return button.

0
On

I found out !

I simply used an UISearchBar with controller !