uisearchcontroller

UISearchController persisting after segue

二次信任 提交于 2019-12-17 10:56:36
问题 I have an app with a UISearchController. This element of the UI is completely set up in code like this: searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.searchBar.delegate = self searchController.dimsBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false searchController.searchBar.searchBarStyle = UISearchBarStyle.Minimal searchController.searchBar.frame = CGRectMake

How to implement UISearchController in UITableView - Swift

北城余情 提交于 2019-12-17 10:19:46
问题 I am a newbie to Swift and I am trying to add search functionality to my UITableView which is in a UIViewController class. I googled a lot and found that UISearchDisplayController has been deprecated and replaced by UISearchController. When I tried to search for tutorials I did not find any specifically for UITableView . Some of them were for implementing in UITableViewController . So here are my questions: Can we implement UISearchController in a UITableView that is in a UIViewController

Cannot set searchBar as firstResponder

无人久伴 提交于 2019-12-17 09:09:04
问题 I have a searchBar I'm setting in a tableviewcontroller. i've referenced this similar question UISearchBar cannot become first responder after UITableView did re-appear but am still unable to set it as first responder. In .h file: @property (strong, nonatomic) UISearchController *searchController; @property (strong, nonatomic) IBOutlet UISearchBar *searchBar; In view didload: self.searchController = [[UISearchController alloc]initWithSearchResultsController:nil]; self.searchController

UISearchController issue, NSLayoutAttribute do not work in real device

社会主义新天地 提交于 2019-12-13 12:44:46
问题 When click the searchController 's cancel button, the Searchbar send back too much, I use constraint to solve that, but , NSLayoutAttibute do not work on real device, but only work on sumilator, using UISearchController in my project , there is a strange issue: So I think out a method to solve the issue, in the UISearchBarDelegate delegate method, when cancel (取消) button click, set the top constant to 0 : // MARK: - search delegate func searchBarCancelButtonClicked() { for item

Search bar overlapping status bar in search controller

喜欢而已 提交于 2019-12-13 03:37:43
问题 I created a UISearchController programmatically in a UITableViewController . It works fine but the search bar isn't displaying correctly with the status bar. Here is my code and some screenshots. It also makes a funny animation when canceling the search. - (void)viewDidLoad { [super viewDidLoad]; _resultsTableViewController = [ResultsTableViewController new]; _searchController = [[UISearchController alloc] initWithSearchResultsController:_resultsTableViewController]; _searchController

Gap above first table with using UISearchController

为君一笑 提交于 2019-12-12 23:23:15
问题 I am not able to remove gap over first table row when testing with iOS 10.3. I tried all solutions suggested on other posts like automaticallyAdjustsScrollViewInsets , added a dummy view above UITableView in hierarchy, e.g. here - but all without success. Here is the setup and scenario. I have a UIViewController that has UITableView. Calling it V1. it is embedded in a nav controller. I am adding UISearchController in viewDidLoad() to tableview header. I am not setting any constraints not

UISearchController searchBar don't disappear when push viewcontroller

走远了吗. 提交于 2019-12-12 10:54:47
问题 I'm using a UISearchController inside ma UIViewcontroller that contains a UITableView , I do this in viewDidLoad : self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.delegate = self; self.searchController.searchResultsUpdater = self; self.searchController.searchBar.delegate = self; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.hidesNavigationBarDuringPresentation = NO; self

How should I present a UISearchController using a UISplitView adaptive user interface?

匆匆过客 提交于 2019-12-12 10:34:10
问题 Using a universal storyboard with an adaptive UISplitViewController user interface. I want to present a search controller on the primary (master) side, using the following code (from the master view controller): static NSString * const kCGISearchViewControllerID = @"SearchViewControllerID"; - (IBAction)searchButtonClicked:(UIBarButtonItem *)__unused sender { SearchViewController *searchResultsController = [self.storyboard instantiateViewControllerWithIdentifier:kCGISearchViewControllerID];

IOS Search bar that appears below navigation

放肆的年华 提交于 2019-12-12 06:43:26
问题 I am attempting to have a search bar tied to my UISearchController that appears below the navigation bar, similar to this: Currently the search bar replaces the title as is common in most/all IOS apps I've seen. I've attempted to control the search bar presentation through a few methods: 1) Creating a new view that sits underneath the nav bar, and assigning the SearchController's search bar to it. //instead of: //navigationItem.titleView = searchBar //do this: searchplaceholder.addSubview

SearchResultsUpdating not being called in UISearchController

元气小坏坏 提交于 2019-12-12 04:41:40
问题 I'm working with UISearchController in Xamarin.Ios and everything works fine but when I start typing, the SearchhResultUpdating method is not override is not firing. It works sometimes and doesn't somw other times but now it doesn't work at all. Here's the SearchResultsUpdating Class: class SearchResult : UISearchResultsUpdating { public event Action<string> UpdateSearchResults = delegate { }; public override void UpdateSearchResultsForSearchController(UISearchController searchController) {