2

As soon as I display my search bar in the navigation controller, the behavior of the search results table changes - the table content is offset vertically by about 60px.

offset results

Changing the table's contentOffset on the delegate ResultsWill/Did Appear makes no difference.

Setting displayInNavigationController = false restores expected alignment of results (directly below search bar with no gap).

The blank area appears to be part of the table/scrollview, as I can force the results cells to temporarily display in the blank section by scrolling down.

Any idea how to get those first result cells to display at the top of the results window?

minerat
  • 1,011
  • 1
  • 7
  • 12
  • This SO question may help http://stackoverflow.com/questions/18925900/ios-7-uisearchdisplaycontroller-search-bar-overlaps-status-bar-while-searching – Mindeater Nov 21 '13 at 02:12
  • Are you by any chance also using a UITabBarController? I am, and am having the same issue. But when I remove the UITabBarController there is no gap. Haven't found a solution just yet. – DonnaLea Mar 18 '14 at 05:40
  • No, I'm not. It was embedded in a navigation controller however. I simply ended up placing a UISegmentedController as the table header view and shifting the frame of the table up by -65.0f to compensate for the gap. – minerat Mar 25 '14 at 14:04

1 Answers1

0

It looks like you have viewController.automaticallyAdjustsScrollViewInsets set, but you don't actually want this adjustment. You can turn this option off via either Interface Builder (find "Adjust scroll view insets" checkbox) or programmatically.

werediver
  • 4,667
  • 1
  • 29
  • 49