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 に答える