<分区>
我正在使用 GMSAutocompleteViewController 并想更改 searchBar 中的 textColor 但找不到方法,我设法更改了一些颜色但没有更改 searchBar 文本。
我尝试了以下代码,但颜色不会改变:
acController.searchBarController?.searchBar.tintColor = UIColor.whiteColor()
acController.searchBarController?.searchBar.textColor = UIColor.whiteColor()
acController.searchBarController?.searchBar.textField.textColor = UIColor.whiteColor()
acController.searchBarController?.searchBar.textField.tintColor = UIColor.whiteColor()
acController.searchBarController?.searchBar.textField.backgroundColor = UIColor.whiteColor()
acController.searchDisplayController?.searchBar.setTextColor(UIColor.whiteColor())
acController.searchDisplayController?.searchBar.tintColor = UIColor.whiteColor()
// changes the color of the sugested places
acController.primaryTextColor = UIColor.whiteColor()
acController.secondaryTextColor = UIColor.whiteColor()