I have a UISearchBar in a tableviewcontroller like so:
self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
self.tableView.tableHeaderView = self.searchBar;
When the user taps in the search bar to search, the searchbar expands to show the cancel button, but then also moves down about 20 pixels, so in effect there is a 20 pixel blank space above the searchbar between the search bar and the navigation bar. I don't understand the moving down behavior and what I can do to prevent it. Does anyone know what exactly might cause that to happen and how I can prevent it?