diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 76d3af972..98556960f 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -89,8 +89,12 @@ self.navigationItem.leftBarButtonItem = nil; // Add the search bar - self.navigationItem.titleView = self.searchBar; - + UIView *searchBarContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; + searchBarContainer.backgroundColor = [UIColor clearColor]; + searchBarContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + self.navigationItem.titleView = searchBarContainer; + [searchBarContainer addSubview:self.searchBar]; self.extendedLayoutIncludesOpaqueBars = YES; // On iPad, there is no cancel button inside the UISearchBar @@ -177,8 +181,9 @@ // Initialise internal data at the first call searchInternals = [[UIViewControllerRiotSearchInternals alloc] init]; - UISearchBar *searchBar = [[UISearchBar alloc] init]; + UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; searchBar.showsCancelButton = YES; + searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; searchBar.delegate = (id)self; searchInternals.searchBar = searchBar; diff --git a/changelog.d/6762.bugfix b/changelog.d/6762.bugfix new file mode 100644 index 000000000..78e6b08b9 --- /dev/null +++ b/changelog.d/6762.bugfix @@ -0,0 +1 @@ +Element freezes after searching in a room. \ No newline at end of file