Ich habe eine UISearchBar in meinem UINavigationItem titleView mit einem UISearchController verbunden. Wenn ich zurück navigiere, scheint es zu blinken. Wer hat das schon mal gesehen?Warum scheint die UISearchBar beim Navigieren zurück zu blinken?
@interface HNTileSearchViewController() <HNTileSearchResultsProtocol, SWRevealViewControllerDelegate, UISearchBarDelegate, HNSetSearchFiltersProtocol, HNKeywordResultsProtocol>
...
@property (nonatomic, strong) UISearchController *searchController;
@property (nonatomic, strong) UISearchBar * searchBarTop;
...
@end
@implementation HNTileSearchViewController
...
- (void) customPreSetup {
HNKeywordResultsTableViewController * searchResultsController = [self.storyboard instantiateViewControllerWithIdentifier:HNKeywordResultsTableViewControllerStoryboardIdentifier];
searchResultsController.delegate = self;
_searchController = [[UISearchController alloc] initWithSearchResultsController:searchResultsController];
_searchController.searchResultsUpdater = searchResultsController;
_searchController.hidesNavigationBarDuringPresentation = NO;
_searchController.dimsBackgroundDuringPresentation = NO;
_searchBarTop = _searchController.searchBar;
_searchBarTop.delegate = self;
_searchBarTop.placeholder = NSLocalizedString(@"Search heynay", nil);
_searchBarTop.showsCancelButton = NO;
_searchBarTop.showsScopeBar = NO;
self.navigationItem.titleView = _searchBarTop;
self.definesPresentationContext = YES;
}
- (void) viewDidLoad {
[super viewDidLoad];
[self customPreSetup];
...
}
....
@end
Danke, @Omzarzi! Der Schlüssel für mich war dieser: '_searchController.searchBar.barTintColor = [HN_APP_DELEGATE brandColor];' –