uisearchdisplaycontroller

UISearchDisplayController gap between overlay and bar

末鹿安然 提交于 2019-12-07 07:01:04
问题 In my app I'm trying to add search functionality. I have table view controller and custom top bar view where I show UISearchBar . The problem is that overlay view is always a bit under the top bar and it adds gap between them: In my table view controller .m file's viewDidLoad : [super viewDidLoad]; LSDropdownViewController *menuCtrl = (LSDropdownViewController *)[self parentViewController]; menuCtrl.topSearchBar.delegate = self; [menuCtrl.topSearchBar setBackgroundColor:[UIColor clearColor]];

Search bar getting hidden by navigation bar when becomes active

孤街浪徒 提交于 2019-12-07 05:49:19
问题 I am facing a weird scenario, I have used a search bar in my application and tied it up with a table view as is seen in the below image! But when ever I try to search anything the search bar slides up and gets hidden by navigation bar, I have used search bar a number of times and never seen me thing like this below is its screen shot ! I can't remove the navigation bar since I need it, but I just can't figure out why or how it can be happening, One point to note is that the search bar and it

How to control the searchResultsTableView of a UISearchDisplayController?

北战南征 提交于 2019-12-07 02:47:00
问题 I wonder how to take control over the table view that is used by the UISearchDisplayController . You can't overwrite the searchResultsTableView property of the UISearchDisplayController , because it is a read-only property. I've tried to overlay the searchResultsTableView by a custom UITableView . That works just once, but as soon as you try a second search, the real searchResultsTableView is on top again. (I mean, you type in some text in the searchBar , your custom table view is on top and

SearchBar in Navigation Bar in iOS7

别说谁变了你拦得住时间么 提交于 2019-12-06 15:11:25
问题 I have a tableview containing all the countries and their flags. I've been working to add a search bar and had it all working until I decided to move the search bar into the navigation bar allowed in iOS7 (for my purposes, that layout works very well). Now, the table loads fine, the search bar shows up fine. As I type into the search bar, I can see the filtered list being built via the console. All looks good, EXCEPT the search results table never displays. In other words, I don't see the

UISearchBar search two arrays

╄→гoц情女王★ 提交于 2019-12-06 09:42:49
I Have a search bar that searches an array, and updates a UITableView with the results. The table view is a list of books, with titles and authors: Right now, the search bar only searches the titles but I would like to make it search the authors as well. Here is the search code I have (I got it from http://blog.webscale.co.in/?p=228 ). - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { [tableData removeAllObjects];// remove all data that belongs to previous search if([searchText isEqualToString:@""]||searchText==nil){ [tableView reloadData]; return; } for

Random UISearchDisplayController Crash (iOS 7)

倾然丶 夕夏残阳落幕 提交于 2019-12-06 08:31:34
问题 I've been trying to fix a crash that around 50% of my users are having. The crash began after I implemented a UISearchDisplayController (ie. added a search bar to a table view), but I haven't been able to reproduce the crash, not even once. According to my users, they instantly crash (or freeze) when they open the table view that has the UISearchDisplayController. According to Crashlytics, the crash is happening at: -[UISearchDisplayController _updateTableHeaderBackgroundViewInTableView

Reloading / Displaying searchResultsTableView of UISearchDisplayController after search method iteration is finished

删除回忆录丶 提交于 2019-12-06 05:57:57
问题 I have modified the code of Apple's sample iOS project TableSearch in order to use it for searching a webservice by parsing its contents. Everything I have implemented works fine except for one ugly detail when performing a search using the SearchDisplayController's SearchBar. I have changed the behaviour of the SearchDisplayController to make it call my search function first when the "Search" button was tapped. The problem is that when the search iteration (which is performed in the

Where does filterContentForSearchText:scope: method come from?

柔情痞子 提交于 2019-12-06 05:36:02
Recently, I noticed that filterContentForSearchText:scope: appeared in multiple tutorials regarding how to implement a search bar. However, I looked up the references of both UISearchDisplayDelegate and UISearchBarDelegate . I found this filterContentForSearchText:scope: is neither a required nor an optional method. I wondered if filterContentForSearchText:scope: is just a conventional method name for filtering search results? Yes, that is only convention for a common method called from the UISearchDisplayDelegate methods - (BOOL)searchDisplayController:(UISearchDisplayController *)controller

Hide UISearchBar of UISearchDisplayController

落花浮王杯 提交于 2019-12-06 04:24:27
问题 I have a tabbar based application, and UInavigationcontroller for every tab. In a TabViewController , I have implemented a UIsegmentedcontrol , searchDisplayController and uitableview. The navigationItems, tabledata are changed based on the segmentedcontrol select. And for a segment i have hidden the search bar. But when the searchbar is hidden, tableview first row does not respond to didselectrowatindexpath . Here is my code, In segment change action - (void)indexDidChangeForSegmentedControl

Objective-C/Xcode 6: Best way to have a Search Bar populate a table view?

浪尽此生 提交于 2019-12-06 04:09:46
I have table view with a Search Bar above it. My intention is to have users enter a query in the search bar and have the table view populate with results - either when the user presses enter or as they're typing. After reading a number of tutorials, I selected the Search Bar and Search Display Controller for the Search Bar. However, it seems this controller is less of an enter-query-then-display-results tool than a filter-existing-table-view-data tool. This means I'm coming upon a table view that already has all the data and is filtered as I type -- what I'd like is to come upon an empty table