gpt4 book ai didi

ios - UISearchController的错位

转载 作者:行者123 更新时间:2023-11-28 18:59:35 25 4
gpt4 key购买 nike

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

结果表没有覆盖主表的整个区域:

enter image description here

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

最佳答案

信不信由你,我通过标记 UINavigationController 设置简单地解决了这个问题:

UINavigationBar.translucent = true

谢谢大家的回复

关于ios - UISearchController的错位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27471345/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com