当我将设备旋转至横向时,searchBar看起来非常糟糕。我该如何解决?
- (void)initializeSearchController {
// Setup the Search Controller
self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
self.searchController.searchResultsUpdater = self;
self.searchController.obscuresBackgroundDuringPresentation = false;
self.searchController.searchBar.placeholder = @"Search";
self.navigationItem.searchController = self.searchController;
self.definesPresentationContext = true;
[self.searchController.searchBar sizeToFit];
self.navigationItem.hidesSearchBarWhenScrolling = false;
// Setup the Scope Bar
self.searchController.searchBar.scopeButtonTitles = @[@"One",@"Two")];
self.searchController.searchBar.delegate = self;
self.searchController.hidesNavigationBarDuringPresentation = true;
}