uisearchbar

Can't use UISearchController with UICollectionView?

▼魔方 西西 提交于 2019-12-03 04:33:08
问题 In the WWDC 2014 talk " A Look Inside Presentation Controllers" the presenters showed how to setup a UISearchController in a UITableView. They do this by setting the searchController's searchBar's frame, then setting it as the tableView's tableHeaderView. Unfortunately, there isn't an equivalent of tableHeaderView for UICollectionView. With UISearchDisplayController, this would be simple: create a UISearchBar and add it to a custom UICollectionView section header, then initialize the

UISearchbar keyboard search button Action

懵懂的女人 提交于 2019-12-03 04:14:20
I'm using UISearchBar when I input text on UISearchBar the keyboard shows. At that time, keyboard return key is "Search". I want to implement event when I press the keyboard search button. How can I implement the action? On UITextField it has -(BOOL)textFieldShouldReturn:(UITextField *)textField; But on UISearchBar it doesn't have return action. Thank you for your helping. Milo Add UISearchBarDelegate in .h Also set SearchBar's object delegate to self. Add this to the UISearchBarDelegate's method: - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder];

Customizing search bar in iPhone application Development

旧城冷巷雨未停 提交于 2019-12-03 03:59:32
In my application I have to add a search bar at the head of the tableview. I am able to add the searchbar but problem is without adding default search bar of ios can i add my customize search bar?? I am giving an image to see what types of search bar will be there... you can subclass the UISearchBar and override the layoutSubviews method : - (void)layoutSubviews { UITextField *searchField; NSUInteger numViews = [self.subviews count]; for(int i = 0; i < numViews; i++) { if([[self.subviews objectAtIndex:i] isKindOfClass:[UITextField class]]) { //conform? searchField = [self.subviews

UISearchDisplayController automatically creates a UIPopovercontroller to display content search result ?! How to dismiss it?

↘锁芯ラ 提交于 2019-12-03 03:33:06
I'm using a UISearchDisplayController with a UISearchBar. I put this UISearchBar in my app using IB and I get : alt text http://img6.imageshack.us/img6/1985/screenshot20100701at156.png Fine : when you start taping, the result popovercontroller appears magically (I didn't write anything on my own to make it appear !) Then, when a row is clicked among the result, I want to dismiss the PopoverController BUT at this stage, I never instantiated the UIPopoverController on my side : it looks like if there's an encapsulated behavior in the UISearchDisplayController that automatically wraps its

UISearchBar delegate not responding to cancel button

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a UIViewController that is a UISearchBarDelegate and a MKMapViewDelegate . The searchBarSearchButtonClicked event works fine, but when testing in iOS 4.2 the searchBarCancelButtonClicked never gets called when hitting the cancel button. In 4.3 everything works fine. I have other views with identical code and it works fine. I have triple checked the method signatures. Could it be something to do with the MapView, or am I doing something blatantly wrong? My .h file: @interface MyViewController : UIViewController <UISearchBarDelegate

Add filter button to UISearchController

安稳与你 提交于 2019-12-03 02:54:43
I want to add a "filter" or "sort" button next to the searchBar inside a UISearchController . I have already tried to add the UIButton and the searchbar into a UIView and set this as my UITableView tableView.tableHeaderView This does not work because the tableView.tableHeaderView get's set back to the UISearchBar only when dismissing the controller. Here is an example of how I want it to look: I could create a search filter with a few lines of code. I hope it helps. *I chose the bookmark button to apply filter icon; because I have already used cancel button for custom action. First, you have

UISearchBar presented by UISearchController in table header view animates too far when active

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using UISearchController to present a search bar inside the header view of a tableview: ... self . searchController . hidesNavigationBarDuringPresentation = NO ; self . presentingTVC . tableView . tableHeaderView = self . searchController . searchBar ; [ self . searchController . searchBar sizeToFit ]; self . presentingTVC . tableView . tableHeaderView = self . searchController . searchBar ; (where setting the tableHeaderView property twice is necessary as otherwise the header view overlaps the first row, c.f. a couple of answers on S.O

Troubles with UISearchBar \\ UISearchDisplayViewController

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm having a hard time with my SearchDisplayViewController on iOS 7. I have a searchBar hidden over a UITableViewController, like self.tableView.tableHeaderView = searchBar; Problem is that when I tap on the searchBar to type in something, then the view starts greying out, and I quickly tap the screen in a random point to dismiss it, coming back to the tableView, the searchBar disappears. Totally. Only on iOS 7 though. Debugging it, the frame is always the same: 0,0,320,44. But the bar is invisible! Also tried to do self.tableView

How to keep scopebar even after pressed Cancel button?

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a UITableView with a searchbar on the top. I used UISearchDisplayController for implementing the same. And also it has a scope bar with two buttons. In default when I launch the app, the scope bar will be displayed. When I click the cancel button after the searching, the scopebar disappeared. So is there any way to keep the scopebar even after I pressed the Cancel button. I used the following code but its not working. - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar { [searchBar setShowsScopeBar:YES]; return YES; } Thanks :)

Broken UISearchBar animation embedded in NavigationItem

匿名 (未验证) 提交于 2019-12-03 01:32:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am experiencing a problem with the new way of adding search bar to the navigation item. As you can see in the picture below, there are two UIViewControllers one after the other, and both have the search bar. The problem is the animation, which is ugly when search bar is visible on the first view controller but not on the second one. The area occupied by the search bar stays on the screen and suddenly disappears. The code is very basic (no other changes in the project were made): (I write primarily in C#, so there might be errors in this