I have this problem with As soon as Here's the thing I've tried to solve: How to solve the idea: I'm glad to have any input for you in advance thanks. OK I think I found a way that works: I just navigate the navigation bar For the right kind of event such as the user gets the back button, see the corresponding code below, although I must add something that some event handling is part of the solution for other "special" behaviors of EDIT: And yes I know that this is ugly - but it is such that if you ask me very little UISearchDisplayController UISearchDisplayController . I want to use it in a dedicated view to handle searches. For my controller class I used the structure of the search bar, search controller and a table widget controller. SearchViewController is linked to a
.xib
@interface SearchViewController: UIViewController & lt; UISearchBarDelegate, UISearchDisplayDelegate, UITableViewDelegate, UITableViewDataSource & gt; {NSSAT * word; UISearchDisplayController * searchController; UISearchBar * searchBar; PhraseTab Viewer Controller * Phrase Touview Viewer; }
SearchViewController appears, searchbar becomes the first sender and search is therefore active. One exception: To return to the previous view, I want to use the Cancel button for searchbar. Now here's the problem: If any underlying table touches the gray area of the view, when no one is searching, the cancel button (and therefore the only way to go back) disappears.
Shows the kernel button = yes on
searchDisplayControllerDidEndSearch . Works, but the resulting UI is ugly in the form of a pulse: the button of the cancel button reappears again.
UITapGestureRecognizer in the search controller's
searchResultTableView is not expected to capture the tap, it still goes.
UISearchBar and override
set to self.searchController.searchBarShowsCancelButton: - did not work.
UISearchDisplayController , which is the navigation The bar appears again at the wrong time (before jumping one expansion Ge which will cause ugly animation).
static BOOL _cancelBtnClicked = no; Static BOOL _phraseClicked = No; - (empty) SearchBarbonButtoned: (UISearchBar *) _Searchbar {if (Self .searchController.active) {_cancelBtnClicked = YES; } And {[self-back]; }} - (zero) searchDisplayControllerDidEndSearch: (UISearchDisplayController *) controller {if (_cancelBtnClicked) {_cancelBtnClicked = NO; [Self back]; } And if (! _phraseClicked) {[Self. Navigation controller set navigation bar: no animated: yes]; }} - (zero) keyboard hahahahid: (nsnification *) notification {if (_phraseClicked) {_phraseClicked = NO; } And if (i.e. ICIV loaded & selfview.indo! = Void) {self.navigationController.navigationBar.hidden = YES; }} - Hide (null) Newspaper Endpoint {self.navigationController.navigationBar.hidden = YES; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Sylector (KeyboardDialHide :) Name: UIKeyboardWillHideNotification Object: Zero]; } - (zero) table view: (UITableView *) table view was SelectionRowAtIndexPath: (NSIndexPath *) indexPath {_phraseClicked = YES; [Self.phraseTableViewController TableView: Table Selection RowAtIndexPath: indexPath]; }
Comments
Post a Comment