uisearchbar

Positioning of scope bar in UISearchController

泪湿孤枕 提交于 2019-12-12 03:22:22
问题 I'm developing a iPad-only app, and I've got a UITableView inside a UIViewController. I setted a UISearchController as the header of the UITableView. This search control has three scopes. I want the scope selector to be below the search bar . With the following piece of code, I'm able to get it at init, but when I start with the input, the selector goes to the right, and remains there . Here is an animation: And here is the relevant code: self.searchController = [[UISearchController alloc]

How to generate custom table view based on textfield input?

喜夏-厌秋 提交于 2019-12-12 03:16:39
问题 I am trying to create an app which has a simple root view controller with a textfield and a button. I want to create a custom table view based on the input of the user in the text field. Imagine this : An App that shows you a list of bikes based on the search input in the text field. Say the user inputs : "Blue Bike" in the text field, the next view will be the one with a table view controller showing all the cells that have Blue or Bike as words in the title. Please guide. 回答1: Have you gone

Making a UISearchBar a drop-in replacement for a UITextField?

我只是一个虾纸丫 提交于 2019-12-12 03:06:14
问题 In interface builder, a UISearchBar seems styled to appear (as you would expect, considering how it is named) in a toolbar, whereas as UITextField is styled to look good on a blank page. Is there a way to make a UISearchBar that does not need to be in a "bar" - such as if you wanted to have multiple search-enabled textfields on a page? My ultimate goal is to have a page full of UITextFields - each of which pops up a predictive search popover as the user fills out the form. I can do the

Adding a SearchBar on TableView

≯℡__Kan透↙ 提交于 2019-12-12 02:44:15
问题 I want to add a search bar in my tableview which is populated with data from Core Data. Below is parts of code from my TableViewController. How do I begin implementing the searchbar function after placing one on the tableview? let managedObjectContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext var fetchedLastName = [String]() var fetchedFirstName = [String]() var fetchedImage = [UIImage]() override func viewDidLoad() { super.viewDidLoad()

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,

Search bar not calling textDidChange for some reason

折月煮酒 提交于 2019-12-12 01:51:43
问题 I'm very new to Xcode so please excuse my ignorance. I have a searchBar and a tableView on a ViewController. I have an IBOutlet for the searchBar and I specified searchBar.delegate = self in viewDidLoad . For some reason textDidChange is not getting called when I type in the search bar. Can anyone help me with this? Thank you. 回答1: I got it working. Even though I specified searchBar.delegate = self in viewDidLoad , it did not work until I specified the searchBar delegate in the storyboard

How can I put a search bar in (not under) a unnavigationbar?

故事扮演 提交于 2019-12-12 01:26:37
问题 I'd like to put a search bar in my navigation bar, like safari has. If I add a UISearchBar to my view, it ends up underneath the navigation bar instead. How can I put a search bar in (not under) a unnavigationbar? 回答1: I do it this way: UISearchBar * navSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 232, 44)]; navSearchBar.delegate = self; self.navigationItem.titleView = navSearchBar; [navSearchBar release]; I hope it helps! 回答2: Try putting UISearchBar or UITextField in

TableView UISearchBar on Tab Bar Controller Crashes while Searching

北城余情 提交于 2019-12-12 01:18:33
问题 I've been playing around with a search facility for my application table view for a while now trying to get it working but i keep getting the same error in my console. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' [NSCFDictionary rangeOfString:options:]: unrecognized selector sent to instance I believe that this following section may be the problem I have tried passing some NSLog entries inside the if statement and it seems to get through it but the problem

Retain UITableView cell state when UISearchBar is used

橙三吉。 提交于 2019-12-11 22:12:03
问题 I am using UISearchBar to search names in UITableView cells. How to retain the cell state when charachters are entered in UISearchBar? I allocated the checkbox in cellForRowAtIndexPath and suppose I made the selection as shown in the screenshot below. Now if I start searching with letter 'S', checkBox state is 'unchecked' as can be seen below. How do I retain the checkBox state even if the cells are "filtered" while searching. I am aware that cellForRowAtIndexPath is invoked every time when

Why combined search bar and scope bar don't align correctly?

风流意气都作罢 提交于 2019-12-11 20:14:08
问题 First of all, quote form iOS User Interface Guidelines When a search bar is present, a scope bar can appear near it. The scope bar displays below the search bar, regardless of orientation, unless you use a search display controller in your code (for more information on the way this works, see UISearchDisplayController Class Reference). When you use a search display controller, the scope bar is displayed within the search bar to the right of the search field when the device is in landscape