Search code examples
ios7xcode5uisearchdisplaycontroller

UISearchDisplayController Frame Issue


I have been using UISearchDisplayController in one of my apps and it has been working great so far until I have encountered an issue. Whenever I try to search through my data on the tableView, the result shows correctly but the frame of the UISearchDisplayController is not right. The search result shows up to half the height of the screen. I have tried to check it out and seen a couple of solutions for this. None of them worked including the most famous one:

-(void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView
 {
CGRect frame = controller.searchResultsTableView.frame;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
   //Changing the frame size here
  }
}

It does not work correctly. Any ideas?


Solution

  • If anyone is interested, @enreas pointed out towards the right direction: https://stackoverflow.com/a/19162257/968925