views:

103

answers:

0

I have integrated a UISearchDisplayController into my controller's xib. The basic functionality I'm going for is to have the search bar in the header of the table, and a button in the navigation bar that shows the search display.

What I'm stuck on: When the cancel is touched, I want to make the searchbar invisible (keep the table so index 0 is show at top, not the search bar), but it stays visible and i'm not sure why (see 3rd image). Any ideas how to always keep the searchbar hidden when the cancel button is touched (see image 1).

What I've tried:

  1. Setting the tableview contentOffset to 44. Which works initially.
  2. Calling [tableview scrollToRowAtIndexPath:....], which doesn't seem to do anything.