gpt4 book ai didi

ios - 搜索时状态栏消失

转载 作者:搜寻专家 更新时间:2023-11-01 06:36:50 24 4
gpt4 key购买 nike

我的状态栏有问题。

我一按我的搜索栏它就消失了,看例子:

在按下搜索栏之前状态栏正常显示: Status bar shows normally before search bar pressed.

状态栏不显示,只是消失在视线之外: Status bar does not show and just disappears out of view

提前致谢! :)

这是我的 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 = "חפש ברים"

}

最佳答案

试试这个设置:

searchController.hidesNavigationBarDuringPresentation = false

并覆盖这个函数(Swift 2):

override func preferredStatusBarStyle() -> UIStatusBarStyle { 
return .LightContent
}

关于ios - 搜索时状态栏消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40538503/

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