iOS 7 UISearchDisplayController search bar overlaps status bar while searching iOS 7 UISearchDisplayController search bar overlaps status bar while searching ios ios

iOS 7 UISearchDisplayController search bar overlaps status bar while searching


Putting the following line in the viewDidLoad fixed it for me:

self.edgesForExtendedLayout = UIRectEdgeNone;


Thank you hodade for leading me on the right track! Your solution worked, except it only moved the search bar's frame, leaving my other subviews in the wrong spot. The only thing I changed was to move all the subviews in my view, as well as animate it.

Thanks!

-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {        CGRect statusBarFrame =  [[UIApplication sharedApplication] statusBarFrame];        [UIView animateWithDuration:0.25 animations:^{            for (UIView *subview in self.view.subviews)                subview.transform = CGAffineTransformMakeTranslation(0, statusBarFrame.size.height);        }];    }}-(void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller {    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {        [UIView animateWithDuration:0.25 animations:^{            for (UIView *subview in self.view.subviews)                subview.transform = CGAffineTransformIdentity;        }];    }}


You're may using no translucent navigation bar?If so, this will solve it.

- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {    self.navigationController.navigationBar.translucent = YES;}- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller {    self.navigationController.navigationBar.translucent = NO;}