andreamazz / andreamazz/AMScrollingNavbar

search controller on ios 11

Aperta
#296 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Swift
Stelle
6k
Fork
628
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi, I have an issue with navigation + search controller on ios11. If I scroll slowly my table view it can happen that search bar doesnt behave as intended-

ex1: I scroll up just a bit more than a half of nav bar height, then release - nav bar gets removed, but parts of search bar remains.

ex2: I scroll very little up, then release - nav bar gets reseted to original height, but search bar now has less height then when I started to scroll. (It doesnt help if I add self.searchController.searchBar as follower)

Any1 else with these issues?
Im using objc. For test purpose you could add property -
`@property UISearchController *searchController;`
method in viewDidLoad -
`[self initSearchController]`
and implementation -
```
- (void)initSearchController{
self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
self.searchController.hidesNavigationBarDuringPresentation = NO;
self.searchController.searchBar.searchBarStyle = UISearchBarStyleDefault;
self.searchController.searchBar.placeholder = @"search";

if (@available(iOS 11.0, *)) {
self.navigationItem.searchController = self.searchController;
}else{
self.navigationItem.titleView = self.searchController.searchBar;
}
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.