I'm using a GMSAutocompleteViewController but the placeholder and Cancel button is not appearing clearly. For this I want to change the placeholder color and the cancel button color. How can I do that. Please help me out.
Asked
Active
Viewed 141 times
1
1 Answers
1
UINavigationBar.appearance().tintColor = .white // cancel button
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).attributedPlaceholder = NSAttributedString(
string: "Search",
attributes: [NSAttributedString.Key.foregroundColor: UIColor(hexString: "#4B4B4C").withAlphaComponent(0.8)]
) // placeholder
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).tintColor = .gray // cursor color