uisearchbar

objective-c uisearchbar only allows one character at a time

一个人想着一个人 提交于 2019-12-24 02:01:05
问题 I have created the following code but there's still one thing that's bugging me. For some reason, when I press any key on the keyboard, it immediately goes away, my cancel bar is disabled, but the code works and it correctly sorts and displays the cells in my table view that have those letters that the user typed in, though only one at a time. Is there something I'm missing? Thanks. Edit: Here's some code that I'm using. Might help figure this out. - (UIView *)tableView:(UITableView *

UISearchBar 'prompt' Not Displaying Properly

寵の児 提交于 2019-12-24 01:15:19
问题 I have setup a UISearchBarController like so: self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchBar.delegate = self; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.searchBar.prompt = @"Searching Transactions Since Nov 11 2017"; self.searchController.searchBar.placeholder = @"Search"; This is the output of setting .prompt : That is how it looks when the view presents and during scrolling.

How to open UISearchBar like iPhone settings search bar?

﹥>﹥吖頭↗ 提交于 2019-12-24 00:46:50
问题 Is there any easy way to handle UISearchBar position similar to iPhone settings search bar ? Because iPhone settings search bar is opening while pull down the screen and open animation controlled by our pull action. I want to do the same in my app. Help me if any easy way you know. Thanks 回答1: I think the easiest way to achieve this animation is: It would be the default behavior for showing/hiding the search bar when adding the search bar inside the scroll view (table view) on top of the cell

Change text of “Cancel” button on a UISearchBar using Monotouch?

你离开我真会死。 提交于 2019-12-24 00:36:24
问题 I need to change the text of the Cancel button to always display "Reset" in my app. I found many similar questions here on SO, but all answers are for ObjC, while I am working in Monotouch. 回答1: Use the extension method below for iOS7+ like this: searchBar.SetCancelTitle("close"); It derives from Kolbjørn Bredrup's comment, which is great, but it wasn't clear to me what the namespaces were for the additional extension methods that it uses internally (OfType and FirstOrDefault) so I added them

iOS 13 Changes to UISearchBar tint's, can't achieve the same outcome

旧街凉风 提交于 2019-12-23 22:16:38
问题 I've been experimenting all day and trying to figure out just how to get my UISearchBar to appear the same in iOS13 as it appears in iOS12/11 So the way the search bar is added is simply a new UISearchController. var searchController = new UISearchController(searchResultsController: null); searchController.SearchBar.Placeholder = "Search"; searchController.SearchResultsUpdater = this; searchController.HidesNavigationBarDuringPresentation = false; searchController

iPhone : hide a scopeBar from a searchBar

耗尽温柔 提交于 2019-12-23 21:38:23
问题 I'm going to look silly again, but it's better than getting crazy! Here's my issue. I have a UISearchBar which has a scopeBar that I want to hide. I do this : searchBar.showsScopeBar = NO; and I also call the [searchBar becomeFirstResponder]; method at the end of the function, but it doesn't work. Any idea ? Thanks 回答1: Okay, for those having the same issue, to hide a scopeBar, you actually need to set the scopeButtonTitles property to nil : searchbar.scopeButtonTitles = nil; and set them

Change UISearchBar background image in iOS11

拥有回忆 提交于 2019-12-23 20:51:47
问题 I want to change my UISearchBar background image. When adding it as the header view in my UITableView it works perfectly fine. However, when I want to change it for the SearchBar being set as the searchController of the navigationItem it won´t change the background image. I´m using: self.searchBar.searchBar.setBackgroundImage(UIImage(named: "#IMAGENAME")?.resizableImage(withCapInsets: UIEdgeInsets.zero, resizingMode: .stretch), for: .any, barMetrics: UIBarMetrics.default) Does anybody know

Change UISearchBar/Keyboard Search Button Title in Swift

a 夏天 提交于 2019-12-23 20:28:08
问题 I'm trying to do the equivalent of this but in Swift and I'm running into problems: No equivalent of try/catch blocks in swift The if statement never seems to be evaluated as true Here is what I've put together so far: for searchBarSubview in self.searchBar!.subviews { if (searchBarSubview.conformsToProtocol(UITextInputTraits)) { var searchBarTextField = searchBarSubview as UITextField searchBarTextField.returnKeyType = UIReturnKeyType.Done } } Does anyone have any ideas where I'm going wrong

UITableView SearchBar filtering inquiry

只谈情不闲聊 提交于 2019-12-23 19:51:28
问题 I have a very long tableView that I am able to search and filter results. However, if I were to type the letter "i" as input, all words with the letter "i" show up. Is it possible to filter in a way so that the letter I type corresponds to the first letter of the word I want to filter. For example my array ["should not use","Tristan","biscuit","is","should not use"] and if I search the word "is" , can that word automatically show up before the word "biscuit"? Expected Result : ["is","biscuit"

MonoTouch.Dialog: UISearchBar Color

浪尽此生 提交于 2019-12-23 18:30:02
问题 In the March 31 release of MonoTouch.Dialog we aren't able to set the color of the UISearchBar anymore now as there is a new container object with hard coded colors. Is there a simpler way to change the color of the UISearchBar ? As a work around, I use this (knowing that the UISearchBar is the last added item to the new class SearchBarBackgroundView : SearchBarBackgroundView sb = TableView.TableHeaderView as SearchBarBackgroundView; if (sb != null) { try { if (sb.Subviews.Count () > 1) {