gpt4 book ai didi

ios - Swift - 如何摆脱 UISearchController 中的深色背景?

转载 作者:可可西里 更新时间:2023-11-01 01:07:20 27 4
gpt4 key购买 nike

我有这个深色背景:

image of the problem

这是我的代码:

class SearchController: UIViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate {

let searchController = UISearchController(searchResultsController: nil)

override func viewDidLoad() {

searchController.searchBar.delegate = self

searchController.searchResultsUpdater = self as? UISearchResultsUpdating
self.definesPresentationContext = true

self.navigationItem.titleView = searchController.searchBar

searchController.hidesNavigationBarDuringPresentation = false

self.definesPresentationContext = true

}

}

我该怎么办?谢谢!

最佳答案

尝试添加这个

searchController.dimsBackgroundDuringPresentation = false

https://developer.apple.com/documentation/uikit/uisearchcontroller

关于ios - Swift - 如何摆脱 UISearchController 中的深色背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55821564/

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