我正在向 tableView.tableHeaderView 添加一个 imageView 和 UISearchController.searchBar。但没有找到正确的方法在图像之后显示 searchBar。
let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 333))
let image = UIImageView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 269))
image.image = #imageLiteral(resourceName: "map")
view.addSubview(image)
view.insertSubview(searchController.searchBar, at: 1)//insertSubview(searchController.searchBar, belowSubview: image)
self.tableView.tableHeaderView = view