uisearchbar

Smart-search for Parse Usernames in Swift not working

久未见 提交于 2019-12-17 06:56:32
问题 I'm trying to have a smart-search in my iOS app so that when a user types a character into a UISearchBar, the results automatically update in the tableview below the searchbar. For some reason, the searchBar function with textDidChange isn't called when I type a character into the search bar. It's called after 2 characters are typed. So my search results are always 1 step behind what's actually typed into the search bar. And it also seems like the search() function is being called twice every

Want to change the position of the cancel button of the UISearchBar

戏子无情 提交于 2019-12-14 03:56:19
问题 I want to change the place where the cancel button appears instead of appearing on the right side as in the image I want it to appear on the left side of the search bar. 回答1: You cannot change the position of the default SearchBar and Search Display controller. For your requirement, you need to create your own custom Search Bar with Cancel as you desire. Hope it helps.. 来源: https://stackoverflow.com/questions/37110334/want-to-change-the-position-of-the-cancel-button-of-the-uisearchbar

UISearchBar with hidden TableView on NavigationBar

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:21:39
问题 I am trying to create a view with a searchBar on the NavigationBar, I want this searchBar to open a tableView with the search results as soon as typing begins, and hide it once an item is touched. I am new to this platform, so I need just a path to follow, I don't know where to start actually. 回答1: According to my comment: Heres a more in depth explanation. Happy coding: .h @interface TableViewController : UITableViewController <UISearchBarDelegate> @property (strong, nonatomic) UISearchBar

Changing the size of UISearchBar

我们两清 提交于 2019-12-14 00:37:08
问题 Not being able to find the answer, and also not being able to do what I want with this: CGSize searchBarSize = self.searchDisplayController.searchBar.frame.size; searchBarSize.width = <someNumber>; I ask: is there a way to change the width of a UISearchBar? Thanks a lot. 回答1: Just as a reference to anybody with the same problem: I created a view with the searchBar image (resized) as a button's background (the button was added as a subview to my view). Then I defined the view containing the

Search of UITableView

℡╲_俬逩灬. 提交于 2019-12-13 21:07:28
问题 I have a UITableView populated from a JSON data feed using an NSDictionary and NSArray and I am trying to search the UITableView data using this code, but it is not working some other related info based on how I set it up is in this question Data from JSON Parsing straight to UITableView - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { // Update the filtered array based on the search text and scope. // Remove all objects from the filtered search array [self

Keep search bar fixed position while scrolling tableView

一个人想着一个人 提交于 2019-12-13 14:03:43
问题 How can i keep the uiSearch bar i created in Xcode 4.3.3 fixed on top while scrolling the table view? Any thoughts? 回答1: EDITED: If u have used the Interface builder to add the search bar, make sure that it is not added as the subview of the tableview (this makes the search bar as a part of the table, which scrolls along with the table). Checkout the link below, and avoid it. This link shows how a search bar becomes a subview of the table. This is not what u want. Just drag the search bar

iPhone perform action when UITextField / UISearchBar's clear button is pressed

不羁岁月 提交于 2019-12-13 12:23:45
问题 Is it possible to gain access to a delegate method that will allow additional actions to be performed when the "clear" button is pressed on a UITextField / UISearchBar? Thanks 回答1: See: UITextFieldDelegate Protocol Reference If you set your view controller as the delegate for your text field (can be done in interface builder), you can use: - (void)clearSearchTextField { ... } - (BOOL)textFieldShouldClear:(UITextField *)textField { if (textField == self.searchTextField) [self

Insert a UISearchBar in IOS 8, Xcode 6 [closed]

我们两清 提交于 2019-12-13 10:14:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . What is the best most efficient way to implement a UISearchBar ? I check all over the internet, and all the tutorials are for the ios 7 version, and a lot of the methods are deprecated in ios 8 . Can someone please provide a library, or a sample of how to implement a searchBar in xcode for ios 8 ? 回答1: I had to

Search Bar Swift 3 - Can't use in/contains operator with collection

雨燕双飞 提交于 2019-12-13 08:45:01
问题 I am implementing a search bar into my project but I am being presented with the below error. reason: 'Can't use in/contains operator with collection wellpleased.attendees.UserData(firstname: "Ben", lastname: "Delonge", fullname: "Ben Delonge", company: "AllStar.com", jobtitle: "Business Development Manager", image: "6.jpg") (not a collection)' I have done plenty of searching around the NSPredicate but cannot seem to prevent this crashing. I am using the code below, any assistance resolving

Why dosent my tableview show search results?

跟風遠走 提交于 2019-12-13 08:10:47
问题 I'm trying to accomplish searching for other users only when the user has typed at least 2 words, and only then begin the search in the database (because I don't want to scan the entire database for the users). I had some problems with 2 letter search, but I think I got the code (thanks to user Jay). However when I run it in the simulator, the console prints name, but nothing shows up in the tableview? (its empty). Do you know what I have done wrong? This is my code: class