【发布时间】:2020-04-06 02:36:23
【问题描述】:
在大多数情况下,我仍然是新手,我正在使用的代码是公司应用程序的一部分,该应用程序已经开发了很长时间。我仍在学习并承担无法积极从事的较小工作。我对许多主题仍然一无所知。这是我与搜索栏相关的代码,我需要更改占位符文本颜色:
func addSearchController() {
// initialize searchResultsController set to nil as we want to use this view controller to display the search results
searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self
searchController.dimsBackgroundDuringPresentation = false
searchController.searchBar.sizeToFit()
searchController.searchBar.tintColor = .white
searchController.searchBar.barTintColor = .ocTopGreen()
searchController.searchBar.searchTextField.textColor = .white
searchController.searchBar.placeholder = "Search for a symptom"
tableView.tableHeaderView = searchController.searchBar
}
任何帮助将不胜感激。
【问题讨论】:
-
这能回答你的问题吗? stackoverflow.com/a/41745002/8374890