【发布时间】:2020-06-04 07:59:12
【问题描述】:
我在我的应用程序中添加了一个 UISearchController,并将它的 searchBar 设置为我的 navigationItem 的 titleView。
这可行,但尽管已将 showsCancelButton 设置为 false,但我看到了取消按钮。
searchController = UISearchController(searchResultsController: searchResultsController)
searchController.searchResultsUpdater = searchResultsUpdater
// Configure the searchBar
searchController.searchBar.placeholder = "Find Friends..."
searchController.searchBar.sizeToFit()
searchController.searchBar.showsCancelButton = false
self.definesPresentationContext = true
navigationItem.titleView = searchController.searchBar
【问题讨论】:
-
你能发布更多你的代码吗?
-
有什么特别的吗?
-
iOS 13 终于修复了这个问题。