uisearchbar

UISearchBar inputAccessoryView

ぐ巨炮叔叔 提交于 2019-12-21 05:31:05
问题 The UISearchBar seems to have the inputAccessoryView as a readOnly property. How do I set it with my own customToolbar ? 回答1: Edit: As is mentioned in the comments below, this is no longer an issue post iOS 6. See the UISearchBar documentation here. The UIResponder (of which UISearchBar is an indirect subclass of) class documentation details a way to accomplish this: Subclasses that want to attach custom controls to either a system-supplied input view (such as the keyboard) or a custom input

Double tap UISearchBar with search delegate on iOS 7 causes UISearchBar to disappear

£可爱£侵袭症+ 提交于 2019-12-21 04:51:42
问题 We have a search bar in the table header. When the user taps on it twice quickly on iOS 7, it disappears. Does anyone have any suggestions what we are doing wrong? 回答1: After lots of trial and errors, I found that when searchDisplayController ends search, searchbar gets disappear, so I have reinserted the searchbar to table header and it worked for me. - (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller { self.searchingFetchedResultsController = nil; if (floor

Focus on the UISearchBar but the keyboard not appear

有些话、适合烂在心里 提交于 2019-12-21 04:03:51
问题 I've read so many solution on how can i focus a searchbar to make keyboard appear when i open my search view, and all of that are like this [searchBar becomeFirstResponder]; mine is [self.searchDisplayController.searchBar becomeFirstResponder]; but I tried both. Now, I tried this, and I also added a [self.searchDisplayController setActive:YES]; because I'm using a SearchDisplayController, but so far the best result i can have is to have the cursor on the searchbar, the uitableview with an

UISearchController doesn't hide view when pushed

℡╲_俬逩灬. 提交于 2019-12-21 03:41:04
问题 I am using UISearchController to display a search bar and results within a UITableView. I managed to set it up correctly, but when I search the results and then select one of the rows in the tableview, and push a new view controller to the navigation stack, I would expect the search bar to not be visible anymore. However, when I try this, the search bar from the first view controller is visible in the 2nd view controller: if (self.searchController == nil) { self.searchController = [

becomeFirstResponder works in viewDidAppear but doesn't work in viewDidLoad

南笙酒味 提交于 2019-12-21 03:32:57
问题 My Application has a modal view controller, including a search bar. When the view comes up, I want the search bar to be focused. I tried [self.searchBar becomeFirstResponder] in viewDidLoad , but it didn't work. Later on I put it in viewDidAppear , it worked. But with this workaround, there is a visible delay. (after the view fully appeared, the keyboard began to appear) I can ensure both viewDidAppear and viewDidLoad have been invoked. What should I do if I want the search bar to be focused

How to show a UISearchBar from top of screen for table view controller

亡梦爱人 提交于 2019-12-21 02:31:23
问题 I'm looking to duplicate how the Facebook Messenger app shows the UISearchBar. When you tap the leftBarButtonItem in the navigationBar, the UISearchBar appears/animates from the top of the screen down, and when you cancel, it simply disappears upwards where it originated from. I used to have my UISearchBar as the default setup in my table view's header (in storyboard), but now I'm wanting to do what I stated above but I am not sure where to begin. My search displayer controller is still in my

UISearchDisplayController not working when created in code?

丶灬走出姿态 提交于 2019-12-21 02:25:10
问题 I'm working on a tab bar application and one of the tabs has a UISearchDisplayController hooked up to a UISearchBar. It's all connected up in the NIB and is working. When I tap the search bar, the Scope and Cancel buttons fly in etc, and the search delegate updates the results table correctly. However, I'm trying to implement the same code in the viewDidLoad message instead of the NIB, however when I delete the search display controller from the NIB and uncomment my code to create the same

Dismissing the keyboard with UISearchBar, without resigning first responder

一世执手 提交于 2019-12-20 20:04:49
问题 Hey, I was working on a navigation-based app on iPhone similar to the contacts app. When you input something in the search bar, and scroll in the table (in the contacts app), the keyboard goes away. I don't think it resigns first responder though, because when I try and do that in -(void)scrollViewDidScroll:(UIScrollView *)scrollView, it disables the cancel button, which does not happen in the contacts app. Basically my question is how do I dismiss the keyboard without disabling the cancel

Can't change search bar tint color to be transparent in iOS 8

两盒软妹~` 提交于 2019-12-20 16:23:06
问题 Upgraded from Xcode 5 to 6 and now my search bar tint is black. Tried to change it through storyboard right pane > "Bar Tint" to clear color, but it's still black. Also tried programmatically: [self.searchBar setTintColor:[UIColor clearColor]]; Still black :( Any ideas? 回答1: The tintColor property on search bars, much like UINavigationBar, changes the color of the buttons, as well as changes the color of the blinking cursor, not the actual search bar background. What you want to use is the

UISearchBar in a UITableView

梦想与她 提交于 2019-12-20 15:28:22
问题 I'm trying to mimic the behaviour of a table view similar to the iPod app for Artists - it's a sectioned table view with a section index on the right, with a search bar at the top, but initially hidden when view shown. I am using sdk 3.1.2 and IB, so simply dragged a UISearchDisplayController into my NIB - it wires everything up for searching. The problem starts because I'm adding the UISearchBar to the first section of the UITableView , because if I understand correctly I must do this so I