Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchBarController iOS 11 issue - SearchBar and scope buttons overlap

Referred here and here. No answer in first link. In the second link, though the answer is not accepted, but the link to apple developer forum gives error.

Before iOS 11 :

enter image description here

iOS 11 :

enter image description here

Note : Same device same code.
Also, this would mean, all apps using this feature have to be republished ?

like image 962
Nitish Avatar asked Sep 22 '17 11:09

Nitish


1 Answers

Adding these lines fixed it for me:

override func viewDidLayoutSubviews() {
    self.searchController.searchBar.sizeToFit()
}
like image 145
Rodge Avatar answered Oct 21 '22 00:10

Rodge