uisearchcontroller

UISearchController Search Bar Position Drops 64 points

為{幸葍}努か 提交于 2019-11-27 18:07:13
问题 The search bar is appearing exactly 64 points too low: All of the other frames are exactly correct. Edit: - It's the UISearchController 's view that is getting the wrong origin.y . It gets set to 64, when it should be 0. If I add this method: - (void)didPresentSearchController:(UISearchController *)searchController { [super didPresentSearchController:searchController]; searchController.view.frame = CGRectMake(0, 0, searchController.view.frame.size.width, searchController.view.frame.size

UISearchController persisting after segue

巧了我就是萌 提交于 2019-11-27 13:56:02
I have an app with a UISearchController. This element of the UI is completely set up in code like this: searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.searchBar.delegate = self searchController.dimsBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false searchController.searchBar.searchBarStyle = UISearchBarStyle.Minimal searchController.searchBar.frame = CGRectMake(searchController.searchBar.frame.origin.x, searchController.searchBar.frame.origin.y, searchController

How to implement UISearchController with objective c

旧街凉风 提交于 2019-11-27 13:50:37
问题 I have an existing app, written in objective-c, with a table view. I am now trying to go back to this app and add a search bar to the table. The problem is that now there is the new UISearchController protocol, there seems to be very little information online in how to implement this within objective-c - all tutorials and examples that I can find are all for Swift. I have added the delegates to the .h file: UISearchBarDelegate, UISearchResultsUpdating And I have the following code in

When assigning focus via becomeFirstResponder to UISearchController's UISearchBar, the keyboard does not appear

一曲冷凌霜 提交于 2019-11-27 12:48:04
问题 I've spent quite a bit of time searching online and talking to other developers about this issue to no avail. The exact issue is described in this SO post (Focus on the UISearchBar but the keyboard not appear), although it's many years old. I recently switched from using the deprecated UISearchDisplayController and UISearchBar in IB, and switched over to UISearchController via the code for iOS8. The problem I'm getting however, is that focus is assigned correctly (you can tell because the

Cannot set searchBar as firstResponder

为君一笑 提交于 2019-11-27 12:01:41
I have a searchBar I'm setting in a tableviewcontroller. i've referenced this similar question UISearchBar cannot become first responder after UITableView did re-appear but am still unable to set it as first responder. In .h file: @property (strong, nonatomic) UISearchController *searchController; @property (strong, nonatomic) IBOutlet UISearchBar *searchBar; In view didload: self.searchController = [[UISearchController alloc]initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; self.searchController.dimsBackgroundDuringPresentation = NO; self

How to implement UISearchController in UITableView - Swift

一笑奈何 提交于 2019-11-27 10:56:14
I am a newbie to Swift and I am trying to add search functionality to my UITableView which is in a UIViewController class. I googled a lot and found that UISearchDisplayController has been deprecated and replaced by UISearchController. When I tried to search for tutorials I did not find any specifically for UITableView . Some of them were for implementing in UITableViewController . So here are my questions: Can we implement UISearchController in a UITableView that is in a UIViewController class? (I guess we can) If we can, please convert these line of codes written in Objective-C. Or if there

Attempting to load the view of a view controller while it is deallocating… UISearchController

江枫思渺然 提交于 2019-11-27 06:51:27
I have code that creates a UISearchController' in my UIVIew's viewDidLoad`. self.resultSearchController = ({ let controller = UISearchController(searchResultsController: nil) controller.searchResultsUpdater = self controller.searchBar.delegate = self controller.dimsBackgroundDuringPresentation = false controller.searchBar.sizeToFit() controller.hidesNavigationBarDuringPresentation = false //prevent search bar from moving controller.searchBar.placeholder = "Search for song" self.myTableView.tableHeaderView = controller.searchBar return controller })() Right after this closure finishes, this

UISearchController disable cancel UIBarButtonItem

寵の児 提交于 2019-11-27 04:41:57
问题 The Problem I am trying to use UISearchController to search for a destination on a map view. I want the UISearchBar to appear in the navigation bar, but I can't seem to make it do so without it showing a cancel button to the right of it: This Cancel button has disappeared at times, whilst I'm playing around, but I can't get it to not appear now I have got the search table showing how I want it to: I'm sure there must be something small I'm doing ever so slightly wrong, but I can't work out

UISearchController doesn't work properly with a non-translucent UINavigationBar

依然范特西╮ 提交于 2019-11-27 03:13:56
问题 Currently I am trying to embed a UISearchController into my application. But the UISearchBar, which is a property of the UISearchController, doesn't get displayed properly, if the UINavigationBar is non-translucent. Usually after tapping the UISearchBar property, the UINavigationBar moves up to make room for the UISearchBar. You can see the result on the following screenshot: https://www.dropbox.com/s/172k63zr2bhj84t/Normal_behaviour.png?dl=0 But if the "translucent" property of the

Cancel button is not shown in UISearchBar

我的未来我决定 提交于 2019-11-27 03:11:29
问题 I have UICollectionView . On clicking search button in UINavigationBar , I am adding the UISearchController 's searchbar as titleview for UINavigationItem . For iPhone it is working properly. For iPad the cancel button is not shown. The Searchbar alone takes the entire width. Can anyone help me out on this?. Thanks in advance. 回答1: iOS7 does not show the cancel button when added to a navigation bar.You can put searchbar in another view like this. UISearchBar *searchBar = [UISearchBar new];