uisearchcontroller

UISearchController: searchBar and scopeBar overlap on first touch event

痴心易碎 提交于 2019-12-04 14:27:12
问题 I'm trying to implement a simple search bar using Apple's latest UISearchController. However I can't seem to get it to work correctly if I use the search bar's scope bar to get a filter choice. The scope bar always shows which I could live with but on the very first touch event the search bar and scope bar overlap. I used Apple's TableView sample code app but it didn't change anything. - (void)viewDidLoad { [super viewDidLoad]; _resultsTableController = [[APLResultsTableController alloc] init

Search Controller with multiple section in UITableView

喜夏-厌秋 提交于 2019-12-04 11:44:21
I have a UIViewController in which I have a UITableView and inside that tableview I have multiple sections which have some item and I have to search with itemname inside that tableview. I have declared this in my view controller let searchController = UISearchController(searchResultsController: nil) override func viewDidLoad() { super.viewDidLoad() searchController.dimsBackgroundDuringPresentation = false definesPresentationContext = true tableView.tableHeaderView = searchController.searchBar searchController.searchBar.barTintColor = UIColor(red: 39.0/255.0, green: 203.0/255.0, blue: 192.0/255

UISearchController changing status bar color on invocation

╄→гoц情女王★ 提交于 2019-12-04 10:45:11
问题 I have the following code in my app, specifically in viewDidLoad: that sets up my UISearchController . self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; self.searchController.hidesNavigationBarDuringPresentation = NO; self.searchController.dimsBackgroundDuringPresentation = NO; self.definesPresentationContext = NO; self.searchController.searchBar.scopeButtonTitles = @[]; self.searchController.searchBar

Strange white space at UITableView header when using UISearchController with UITableViewController on iOS 10

别等时光非礼了梦想. 提交于 2019-12-04 10:38:15
The white space only appears on iOS 10. I ran into this problem as well. If you have the vertical scroll indicator enabled, you should be able to see that it's a UIScrollView 's inset issue. And seems like it only happens when you use a UITableViewcontroller as the searchResultsController of a UISearchController . And this extra space is visible at both the top and bottom of the view. This answer is not pretty, but I'm adding this in for now. if #available(iOS 10.0, *) { automaticallyAdjustsScrollViewInsets = false tableView.contentInset = UIEdgeInsetsMake(64, 0, 44, 0) } You're setting a

Show keyboard automatically when UISearchController is loaded

你离开我真会死。 提交于 2019-12-04 09:31:10
问题 I created a UISearchController in a table view controller. I segue to this table view controller using a push segue from another view controller. I want the keyboard to show up with the cursor in the search bar as soon as the table view controller is pushed. I made the search controller active in the viewDidLoad method using self.mySearchController.active = true It does make the search controller active but this does not bring up the keyboard nor is the cursor placed in the search bar. I also

Make UISearchController search bar automatically active

那年仲夏 提交于 2019-12-04 03:41:05
I've implemented a UISearchController with its search bar in a navigatiom bar and I would like to make the search bar active when the view is loaded. When I say active, I mean that the keyboard appears and the user can type his/her search without tap the search bar. I initialised the UISearchController with the following code: - (void)viewDidLoad { self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; [self.searchController setSearchResultsUpdater:self]; [self.searchController setDimsBackgroundDuringPresentation:NO]; [self.searchController

UISearchController searchbar hides the first cell in tableview

蹲街弑〆低调 提交于 2019-12-04 01:05:47
问题 I have a tableview with a search bar. The search bar is provided by a UISearchController. When I add the search bar to the header view of the table, the first row of the table gets covered by the search bar. How do I prevent the search bar from hiding the first row? I have this snippet in viewDidLoad: self.searchController = UISearchController(searchResultsController: nil) self.searchController.searchResultsUpdater = self self.searchController.searchBar.delegate = self self.tableView

Custom UISearchController Animation

假装没事ソ 提交于 2019-12-04 00:09:11
问题 The Bottom Line Question: How do I override the default animation for the dismissal of a searchBar belonging to a UISearchController? Standard Search Controller Behavior: Okay so I am trying to create a custom animation for when the UISearchBar that is attached to a UISearchController becomes active. It seems the standard animation expects for the searchBar to begin with a width that takes up the screen. When the animation begins it shrinks the searchBar and fades in a cancel button to the

UISearchController searchBar in tableHeaderView animating out of the screen

时光毁灭记忆、已成空白 提交于 2019-12-03 18:57:27
问题 I have a UISearchController with a UITableViewController as a searchResultsController , the UISearchBar of this searchController is set to be in the tableHeaderView of my current tableView displayed in my root ViewController. Almost everything is working well, as expected. But in the animation of the UISearchBar (When i click on the searchBar and the UINavigationBar hides and the searchBar goes to the top, as in the UISearchDisplayController ) i have a strange behavior. Instead of moving to

Make UISearchBar dismiss like Music App

百般思念 提交于 2019-12-03 16:44:39
Notice how the searchBar magnifying glass and placeholder text both shift over on dismissal: Is there any way I could dismiss this search bar without the text and icon moving over? See the animation of the Music app for the animation I am trying to achieve. I have a UISeachBar that gets presented when the search button is clicked in a nav bar. @IBAction func searchButtonPressed(sender: AnyObject) { searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.searchBar.delegate = self searchController