gyozo kudor
gyozo kudor

Reputation: 6335

Navigation bar disappears when scrolling results from a search display controller

I have a view with a search bar and a search display controller. It is the root view of a navigation controller. The search display controller acts as an autocomplete for the search bar. The problem is the following: I enter a letter in the search bar and the autocomplete results appear. I scroll down to the end of the results table view. After that I change my mind and type in another few letters until there are only 3 words in the table. I select a result in the table. In the didSelectRowAtIndexPath I save the value that was selected and deactivate the search display controller using setActive: FALSE animated: TRUE. When it deactivates the navigation bar is missing. What did I do wrong?

Example: I type in H. A long list of keywords appear. I scroll down. I change my mind and type OT so the text in the search bar is now HOT there are approx. 6 keywords remaining, I select HOTEL. When I'm back the navigation bar is gone. I kill the app since it's useless. Next time I type in HOT ; without first scrolling down to see all the results, and after that I select HOTEL. This time it works, the navigation bar is still there.

EDIT: I think the problem appears when I have to scroll through the results if there is only one page of results it works ok.

Upvotes: 0

Views: 952

Answers (1)

gyozo kudor
gyozo kudor

Reputation: 6335

Solved by using [self.navigationController setNavigationBarHidden:NO animated: YES].

Upvotes: 1

Related Questions