Friday 15 January 2010

ios - UISearchController Search Box Shift Down on Tap -


If I apply a UITableVIewController that UISearchBarDelegate, visual embedded inside a navigation controller.

  Class utility viewer: UITableViewController, UISearchResultsUpdating, UISearchBarDelegate, AmenityFilterDelegate {// MARK: - Public Variables var targetFacilities = [Int] () var searchController: UISearchController = UISearchController (searchResultsController: void) // Mark: - Private Variable View Private Violence Model: FeatureTabVyModel! Private education parkGreenColor = UIColor (red: 73/255, Green: 136/255, blue: 84/255, alpha: 1) private var showEmptyMessage = false // Mark: - Show Lifecycle / ** Loading * / override after setup visual function viewDidLoad () {super.viewDidLoad () trackScreenView ( "see the feature table") If targetFacilities.isEmpty {ViewModel = FacilityTableViewModel ()} else {ViewModel = FacilityTableViewModel (facilityIds: targetFacilities)} // Seup search controller searchController .searchResultsUpdater = Self SearchController.dimsBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false searchController.searchBar.frame = CGRectMake (self.searchController.searchBar.frame.origin.x, searchController.searchBar.frig.origin.y, searchContr Oller.searchBar.frame.size.width, 44) SearchController.searchBar.tintColor = UIColor.whiteColor () searchController.searchBar.barTintColor = parkGreenColor searchController.searchBar.translucent = false self.definesPresentationContext = true tableView.tableHeaderView = searchController.searchBar}  

"Before Tap on Search"

I found that when I navigation bar of translucent property search box disable

after tapping Search

If I set the defined rendering preview = false , the search bar is too low Not known, although I enter text into the search box and he selects one of the results which can not open a modal window. I get the following error:

search results

  2015/03/17 15: 06: 56.101 VB ParkFinder [16,368: 2,667,719] Warning: Attempting to present & lt; UINavigationController: 0x7fa2f9ced930 & gt; On & lt; VB_ParkFinder.FacilityTableViewController: 0x7fa2f9c27ba0 & gt; Which has been already presented (zero)  

Below is my segue code:

  prepareForSegue override function (segue: UIStoryboardSegue, this: AnyObject) {NavController go = Segue.destinationViewController as UINavigationController if segue.identifier == "facilityDetailsSegue" {detailsViewController = navController.childViewControllers as Provide Feedback as ViewViewController Index Path = tableView.indexPathForSelectedRow () {var Feature ID: Int If searchController.active {facilityId = viewModel.idForSearchResultsAtIndexPath (IndexPath)} else {facilityId = viewModel.idForilityAtIndexPath (indexPath)} detailsViewController.currentFacilityId = facilityId}} and if segue.identifier == "Fi lterPopover "Amenit YFilterTableViewController as {Aftivisi = navController.childViewControllers.last aftvc.delegate = self}}  

I'm lost as to what to do. I want to turn off the navigation bar transit and I should be able to launch a modal window from the search results. Any ideas on how to accomplish this?

I had a single problem, but take a look

This solves my problem.

It seems that it can be marked as a duplicate, not to make sure how to do it.


No comments:

Post a Comment