diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 7f4fe2eef..73b14b55f 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -104,6 +104,8 @@ // Add the search bar self.navigationItem.titleView = self.searchBar; + + self.extendedLayoutIncludesOpaqueBars = YES; // On iPad, there is no cancel button inside the UISearchBar // So, add a classic cancel right bar button diff --git a/Riot/Modules/Contacts/ContactsTableViewController.m b/Riot/Modules/Contacts/ContactsTableViewController.m index 2b3548a0d..a4002e005 100644 --- a/Riot/Modules/Contacts/ContactsTableViewController.m +++ b/Riot/Modules/Contacts/ContactsTableViewController.m @@ -179,6 +179,13 @@ [[NSNotificationCenter defaultCenter] removeObserver:kAppDelegateDidTapStatusBarNotificationObserver]; kAppDelegateDidTapStatusBarNotificationObserver = nil; } + + if (!self.searchBarHidden && self.extendedLayoutIncludesOpaqueBars) + { + // if a search bar is visible, navigationBar height will be increased. Below code will force update layout on previous view controller. + [self.navigationController.view setNeedsLayout]; // force update layout + [self.navigationController.view layoutIfNeeded]; // to fix height of the navigation bar + } } #pragma mark -