My app hide the navigationbar in the beginning.
But in a view(full screen), there is a search bar.
when I begin to search, the search bar stays in the top of the view.
Then I cancel the search,change the search bar's frame,the navigationbar appears.
Why does this happen? how can I hide the navigation bar ?
I tried this:
I add some logs in searchDisplayControllerWillEndSearch and searchDisplayControllerDidEndSearch
to show navigtaionbar status.
In searchDisplayControllerDidEndSearch, navigationController.navigationBarHidden is YES,
In searchDisplayControllerDidEndSearch, navigationController.navigationBarHidden is NO.
Then I set navigationController.navigationBarHidden to YES
in searchDisplayControllerDidEndSearch
,The navigation bar will show but hide in a short time,and navigation bar will never show again.(navigationController.navigationBarHidden
will always be YES)
Any ideas?
Thanks!