views:

37

answers:

0
self.searchbarRect = self.searchDisplayController.searchBar.frame;
self.searchDisplayController.searchBar.frame=CGRectZero;
self.searchDisplayController.searchBar.hidden = YES;

I use this code to hide the searchbar on a tableview. The problem is that when I show the searchbar again, it overlaps with the first cell of the table.

self.searchbarIsHidden = NO;
self.searchDisplayController.searchBar.hidden = NO;
self.searchDisplayController.searchBar.frame =  self.searchbarRect;

This makes the searchbar overlap the first tableViewCell... How do I avoid this?