Próbuję zrozumieć, dlaczego cały pasek nawigacyjny znika, gdy zaczynam wpisywać w UISearchController.searchBar. Ładuje się poprawnie i animuje poprawnie, ale tracę aktywny NavBar po uruchomieniu pisanie na maszynie. Oto kod, aby załadować searchController z viewDidLoad:Pasek nawigacyjny znika po wpisaniu w polu tekstowym UISearchController
UITableViewController *searchResultsController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
searchResultsController.tableView.dataSource = self;
searchResultsController.tableView.delegate = self;
searchResultsController.tableView.backgroundColor = [UIColor redColor];
self.searchController = [[UISearchController alloc] initWithSearchResultsController:searchResultsController];
self.searchController.delegate = self;
self.searchController.searchResultsUpdater = self;
self.searchController.dimsBackgroundDuringPresentation = YES;
self.searchController.hidesNavigationBarDuringPresentation = NO;
[self.searchController.searchBar sizeToFit];
self.tableView.tableHeaderView = self.searchController.searchBar;
self.definesPresentationContext = NO;
A oto wynik po zacznę wpisując:
zauważyć, jak widok tabeli istnieje, ale wydaje się, że zajmują przestrzeń kontrolera nawigacyjnego i rozciągają się w dół do pierwszego nagłówka sekcji. Jakieś pomysły?
Dzięki.
Rozwiązałeś to? – eestein
opublikował rozwiązanie poniżej, ale nie jestem pewien, gdzie dokładnie był problem. =] – 4m1r
np. Dzięki, przyjrzę to – eestein