In our app, when you click into the search bar on an iPhone, the scope buttons appear under the search text field instead of below it. After rotating the phone to Landscape, the scope buttons move to the right of the search text field, so they show correctly. When rotating back to Portrait, the scope buttons are hidden under the text field again.
This did not happen on with iOS 11 beta 4; it only started happening when we put iOS 11 beta 5 on a phone. We upgraded to beta 6 this week, and it still has the problem. (We have a phone still on beta 4, and the same version of the app works fine there.)
We add the search controller / search bar with scope buttons to UITableViewController in viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
[...]
_searchResultsController = [[UITableViewController alloc] init];
_searchResultsController.tableView.dataSource = self;
_searchResultsController.tableView.delegate = self;
self.searchController = [[UISearchController alloc] initWithSearchResultsController:_searchResultsController];
self.searchController.searchResultsUpdater = self;
self.searchController.delegate = self;
self.searchController.dimsBackgroundDuringPresentation = YES;
self.searchController.searchBar.scopeButtonTitles = @[NSLocalizedString(@"From",@"From"),
NSLocalizedString(@"To",@"To"),
NSLocalizedString(@"Subject",@"Subject"),
NSLocalizedString(@"All",@"All")];
self.searchController.searchBar.delegate = self;
[self.searchController.searchBar sizeToFit];
self.tableView.tableHeaderView = self.searchController.searchBar;
self.definesPresentationContext = YES;
[..]
}
Is anyone else seeing this issue?