谷歌地图自动完成更改颜色

Pan*_*včí 4 google-maps uitextfield ios swift gmsautocomplete

我正在寻找改变颜色的 GMSAutocompleteViewController

这是我得到的:

截屏

我希望文本字段为白色,带有白色取消按钮。

Pan*_*včí 6

斯威夫特 3

@IBAction func searchCityBtn(_ sender: Any) {
        let autocompleteController = GMSAutocompleteViewController()
        autocompleteController.delegate = self
        UINavigationBar.appearance().barTintColor = UIColor(red: 44.0/255, green: 44.0/255, blue: 49.0/255, alpha: 1.0)
        UINavigationBar.appearance().tintColor = UIColor.white

        UISearchBar.appearance().setTextColor(UIColor.white)
        UISearchBar.appearance().barStyle = UIBarStyle.default
        UISearchBar.appearance().setPlaceholderTextColor(.white)
        UISearchBar.appearance().setSearchImageColor(.white)

        self.present(autocompleteController, animated: true, completion: nil)
    }
Run Code Online (Sandbox Code Playgroud)

有关您可以在此处编辑内容的更多信息......感谢上帝,他们更新了他们的框架和文档!干杯!

  • 这些方法在哪里?“setTextColor”、“setPlaceholderTextColor”、“setSearchImageColor”。你有没有写任何扩展?如果是,那么也请分享。 (8认同)