3

iOS8 Swift UISearchController hides navigationbar

I am facing same problem as in above link. So I have added following line.

self.searchController.hidesNavigationBarDuringPresentation = NO;

But now UISearchController's search bar is shifting down and some blank space is created on search bar's place. If I click cancel button, then search bar is restored to original position.

please help me to fix this issue in iOS 8 using objective-C.

Community
  • 1
  • 1
user3898700
  • 141
  • 1
  • 12

1 Answers1

0

For some reason (I believe this is a bug), UISearchController can place the search bar incorrectly on presentation if its frame coordinates are something other than (0,0).

To work around this, create a UIView where you want the UISearchBar to be and add the UISearchBar as a subview.

You might also be running into this bug: http://openradar.appspot.com/20942583

AndrewR
  • 10,759
  • 10
  • 45
  • 56