andreamazz / andreamazz/AMScrollingNavbar

search controller on ios 11

Offen
#296 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Swift
Sterne
6k
Forks
628
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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;
}
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.