uisearchbar

UISearchDisplayController on iOS7

我的未来我决定 提交于 2019-12-13 02:47:43
问题 I'm having a very annoing problem on iOS7. I have a VC with different subviews, one is a tableview that is display fullscreen after pressing a button. This tableview has a search bar with a scope bar in its header that is linked to a search display controller. On iOS 6 everything runs fine, when I press on the search bar the scope bar is displayed and the rows correctly slide at the bottom as you can see in the images (forget about the big X). On iOS7 I have a problem. Everything seems OK(and

How to change inputView of UISearchBar in iOS7?

大兔子大兔子 提交于 2019-12-13 02:16:19
问题 In iOS6 , I use the below code to change inputView of UISearchbar for (UIView *view in _searchBar.subviews) { if ([view isKindOfClass: [UITextField class]]) { UITextField* textField = (UITextField*)view; [textField setInputView:_myKeyboard]; break; } } UISearchbar in iOS7 had changed, I don't know how to find textField to change inputView. Please help! Thanks! 回答1: The hierarchy of subview has been changed in iOS7, so you can use the following code: // subviews NSArray *searchBarSubViews = [

UISearchBar in UINavigationBar changes width when rotating orientation

≯℡__Kan透↙ 提交于 2019-12-13 02:11:28
问题 This is driving me crazy. I am creating a splitview app on iPad. I have created a searchBar inside the UINavigationBar - something like this... UISearchBar *searchBar = [[UISearchBar alloc] initWitFrame:CGRectZero]; [searchBar setPlaceHolder:@"Search"]; [searchBar sizeToFit]; [searchBar setDelegate:self]; [self.navigatioItem setTitleView:searchBar]; this works just fine for me displaying the UISearchBar like this... I also have this UIBarButtonItem set to show Master navigation controller in

uisearchbar in grouped section uitable

Deadly 提交于 2019-12-13 00:28:44
问题 I've pieced together several tutorials to create a grouped table with sections and I'm now trying to get a uisearchbar to work. the problem I'm having is how to search within the grouped sections. I've read the similar questions this post suggested but can't This is the code to create the grouped sections #import "Job.h" // A model for the data #import "Address.h" // Another model for the data - (void)viewDidLoad { [super viewDidLoad]; self.theTable.delegate = self; self.theTable.dataSource

IOS Swift Searching table from an Array

浪子不回头ぞ 提交于 2019-12-12 16:23:06
问题 I have just started to learn swift and i am looking at the tableview and searchbar feature. Below i have my array which is a list of fruits: var fruits: [[String]] = [["Apple", "Green"],["Pear", "Green"], ["Banana", "Yellow"], ["Orange", "Orange"]] I have them in a table view with the name of the fruit as the title and the colour as a subtitle. I am trying to use the search bar to filter but i cant seem to get it right. I only want to search for the name of the fruit not the colour. var

Delay UISearchbar parsing

给你一囗甜甜゛ 提交于 2019-12-12 12:02:16
问题 I have a UISearchbar in my app. This is a dynamic search and as the user enters text, a remote database is searched via a remote API call (I think it is through REST). The table view gets refreshed dynamically, as the user types. I am using NSXMLParser for parsing the XML results. (so 3 delegate methods; didStartElement, didEndElement) In some cases, there are duplicate entries shown in the results e.g. If user has typed YAH, it shows YAHOO 3-4 times. I'm not sure why. How can I reduce the

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

UISearchBar : How to prevent Cancel Button from clearing text?

百般思念 提交于 2019-12-12 10:46:00
问题 I have a screen with an UISearchBar within my app. It might be that there is already text in the searchbar, when the user enters the screen. If the user then taps into the field and then taps cancel, the content of the searchbar should not be cleared. Is this achievable? I tried to implement searchBarCancelButtonClicked , but my modifications to the text property were ignored and the text field was still cleared. 回答1: I ran in to this same problem and solved it by manually tracking the state

Help with Search bar scope buttons

廉价感情. 提交于 2019-12-12 10:24:48
问题 I have a UI that displays data from a user table like FirstName, LastName, Email,etc. Now i want to create a search bar along with scope buttons that filters data depending on the scope button clicked. I have 2 scope buttons, FirstName and LastName. By default FirstName button is selected. Below is how I add my data to a mutablearray, userData = [[NSMutableArray alloc] init]; for (NSDictionary *tmpDic in response) { [userData addObject: [NSString stringWithFormat: @"%@ %@", [tmpDic

UISearchBar - what is “search results button” for?

爷,独闯天下 提交于 2019-12-12 08:19:43
问题 (Duplicate of this question, but I figured I could try again, since that one wasn't answered...) The UISearchBar on the iPhone has an option showsSearchResultsButton. When you turn it on, it shows a button with horizontal lines inside the search bar, and you can implement a callback that will be called when the user presses it. The thing is, I can't find a single place on the Internet where it says what the intended purpose of this button is. I know I could make it do anything, but I'd like