uisearchdisplaycontroller

Displaying search bar in navigation bar in iOS 8

╄→гoц情女王★ 提交于 2019-12-17 07:12:47
问题 UISearchDisplayController had a boolean property called displaysSearchBarInNavigationBar . What's the equivalent in iOS 8 to have my search bar move up there? Any guidance is greatly appreciated. Here's my code, I'm not entirely sure why this isn't working. When I click the search bar, it just disappears instead of moving itself and the navigation bar up. import UIKit class ViewController: UIViewController, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate,

Simplest way for UISearchDisplayController to show same cells as the origin

落花浮王杯 提交于 2019-12-14 03:09:16
问题 What's the simplest way to make UISearchDisplayController display exactly the same cells (formatting, height, fonts, colors, etc) as the original tableView that it searched on? or simply put - make it dequeue de same cell identifier? I am using a the standard subclassed UITableViewController + UISearchDisplayController solution, and prefer to stick to it. thanks 回答1: I actually found the simplest way. All I had to do is change the default cellForRowAtIndexPath second line of code and add the

Repopulating UITableView after search

本小妞迷上赌 提交于 2019-12-13 06:05:18
问题 I'm using single NSFetchedResultController to populate both self.tableView and UISearchDisplayControler.tableView . After using search bar and dismissing it if I select any row in the self.tableView I get this error: Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' I guess that somewhere I miss reloading data but I have no clue where? Here are some methods which I use for populating both tabble

UISearchBar is resizing after dismissal

 ̄綄美尐妖づ 提交于 2019-12-13 05:13:06
问题 I have a tableviewcontroller with a button, textfield, and a search bar display controller in the header view of the tableview. When I click on the searchbar, then on either cancel or the background tableview(to dismiss it), the search bar will re size to cover the entire view it was in(over the button and text field). In viewDidLoad I have self.searchBar.translatesAutoresizingMaskIntoConstraints = YES; Any ideas please? 回答1: Just add height and width constraints to the search bar and pin it

Using becomeFirstResponder causes cancel button to not work

六眼飞鱼酱① 提交于 2019-12-13 03:43:52
问题 I have a UISearchDisplayController (searchDisplayCtr) and a UISearchBar (searchBar). I am trying to give focus to the search bar and bring up the keyboard when I click the search icon in the alphabet scroll on the right. If I include, [self.searchDisplayCtr setActive:YES]; [self.searchDisplayCtr.searchBar becomeFirstResponder]; It brings up the keyboard and selects the search bar but the cancel button does not work consistently. I have tried resigning first responder, setting active to NO and

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

UISearchDisplayController with UITableViewController

此生再无相见时 提交于 2019-12-12 08:41:57
问题 I have a UITableViewController , in which I added a UISearchBar as the tableHeaderView using Interface Builder. Then I added a UISearchDisplayController in the nib, and set up all the connections ( delegate , searchResultsDelegate , searchContentsController , searchResultsDataSource , all connected to the UITableViewController ). I then implemented all the delegate and data source methods in my code. It works like a charm, except for a weird bug: sometimes the search results table view won't

UISearchDisplayController strange behaviour with searchResultsTableView and self.tableView

Deadly 提交于 2019-12-12 02:32:45
问题 this is my storyboard view and it's connections: http://i.stack.imgur.com/uD0pT.png http://i.stack.imgur.com/FNnVa.png In my specific case I have the searchResultsTableView that gets its data from the first external web service and the self.tableview that fetches data from another web service. I add some code to be clear: -(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { ... } this fetched the first web services,

My SearchDisplayController doesn't work well with UITableView in UIViewController

做~自己de王妃 提交于 2019-12-12 02:22:43
问题 Here I have a Search Bar on the top of the UIViewController, and also a UITableView below the Search Bar. When I don't Search things, the tableView could display things well, but when I search, the searchResultTableView can only show some white cell, not the correct result. Here is the .h file: #import <UIKit/UIKit.h> @interface MySearchViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @property (weak, nonatomic) IBOutlet UITableView *myTableView; - (void

Restrict the overlay view frame in UISearchDispalyController

旧街凉风 提交于 2019-12-11 19:12:50
问题 I am using UISearchDisplayController when user type a keyword to search , an overlay view covers my view controller. I can not interact with my view controller, until i press the cancel button of search bar. I need to restrict the overlay view frame, so that I can interact with my view controller. 来源: https://stackoverflow.com/questions/28601177/restrict-the-overlay-view-frame-in-uisearchdispalycontroller