0

我的 UISearchController 有问题。我无法将它与 tableView 正确放置。

结果表未涵盖主表的整个区域:

在此处输入图像描述

resultsTableController = ScuoleSearchResultsTableController()
resultsTableController.tableView.delegate = self
searchController = UISearchController(searchResultsController: resultsTableController)
searchController.searchResultsUpdater = self
searchController.searchBar.sizeToFit()
tableView.tableHeaderView = searchController.searchBar
searchController.delegate = self
searchController.dimsBackgroundDuringPresentation = true // default is YES
searchController.searchBar.delegate = self    // so we can monitor text changes + others
// Search is now just presenting a view controller. As such, normal view controller
// presentation semantics apply. Namely that presentation will walk up the view controller
// hierarchy until it finds the root view controller or one that defines a presentation context.
definesPresentationContext = true
4

1 回答 1

4

信不信由你,我只是通过标记 UINavigationController 设置来解决:

UINavigationBar.translucent = true

感谢所有回复

于 2014-12-15T11:18:26.317 回答