我的状态栏有问题。
当我按下我的搜索栏时,它就消失了,看看例子:非常感谢! :)
这是我的searchController设置:
override func viewDidLoad() {
super.viewDidLoad()
definesPresentationContext = true
self.resultsController.tableView.dataSource = self
self.resultsController.tableView.delegate = self
self.searchController.hidesNavigationBarDuringPresentation = false
self.searchController = UISearchController(searchResultsController: self.resultsController)
self.tableView.tableHeaderView = self.searchController.searchBar
self.searchController.searchResultsUpdater = self
self.searchController.dimsBackgroundDuringPresentation = true
self.searchController.searchBar.sizeToFit()
self.searchController.searchBar.barTintColor = UIColor.blackColor()
self.searchController.searchBar.endEditing(true)
self.searchController.searchBar.placeholder = "חפש ברים"
}
答案 0 :(得分:3)
尝试此设置:
searchController.hidesNavigationBarDuringPresentation = false
并覆盖此功能(Swift 2):
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return .LightContent
}