我正在尝试更改搜索栏的颜色问题是当我取消按钮失去颜色而我无法看到它。如果您有任何想法,请告诉我。谢谢!
代码:
self.searchController = UISearchController.init(searchResultsController: searchDataSource)
self.searchController?.obscuresBackgroundDuringPresentation = true
self.searchController?.searchBar.delegate = self
self.searchController?.searchBar.showsCancelButton = true
self.searchController?.searchBar.placeholder = "Search for items"
self.searchController?.searchBar.isTranslucent = false
self.searchController?.searchBar.barTintColor = UIColor.white
self.searchController?.searchBar.tintColor = UIColor.black