点击{/ 1}并取消它后,我意识到search bar
的某些奇怪行为。 Here是一些简短说明的图片。单击search bar
会隐藏在stack view
下。 search bar
处于活动状态时,导航不可用。
单击取消后,导航将再次可用。
每个控制器都嵌入在navigation controller
中。我的基本控制器是UIViewController
searchController.searchBar.delegate = self
navigationItem.title = navigationItem.title ?? ci("plan_p")
tableView.rowHeight = 100.0
tableView.tableHeaderView = searchController.searchBar
self.tableView.setContentOffset(CGPoint(x: 0.0, y: (self.tableView.tableHeaderView?.frame.size.height)!), animated: true)
guard let projectId = GlobalState.selectedProjectId, let byProject : Results<Structure> = self.by(projectId: projectId) else {
return
}
if (navigationItem.title != nil) {
searchController.searchBar.scopeButtonTitles = [String(format: "gesamte %@", ci("project_s")), String(format: "in %@", navigationItem.title!)]
}
searchController.searchResultsUpdater = self
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.placeholder = "Suche nach Plan"
definesPresentationContext = true