I am using the new UISearchController with searchbar inside tableview header.Everything works fine in portrait orientation but when I rotate to landscape and uisearchbar start editing its frame is out of screen,clipping the cancel button.
my code for creating searchcontroller
tableView.tableHeaderView = searchController.searchBar
Here is my sample code UISearchController sample
Rotation has no frame issue in landscape but only when uisearchbar starts editing [![landscape searchbar](https://i.stack.imgur.com/4DwTY.png)
![Cancel button clipping](https://i.stack.imgur.com/CltWk.png)
When rotate back to portrait layout of uisearchbar is still incorrect
There is no issue if I use UITableviewController but I have to implement with uitableview.Is there any setting I am missing in iOS 14 ?
Note:I have to use tableHeaderView not navigationItem.searchController = searchController
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…