首页 > 解决方案 > GMSAutocompleteViewController 去掉“取消”按钮

问题描述

我正在尝试删除 google maps API for ios 的 GMSAutocompleteViewController 中的默认“取消”按钮。我该怎么做呢?这可能吗?

在此处输入图像描述

在此处输入图像描述

标签: iosswiftgoogle-mapsswiftui

解决方案


GMSAutocompleteViewController 没有“SearchBar”对象的任何引用来更改或隐藏“取消”按钮。您可以在 GMSAutocompleteViewController 内部检查“SearchBar”是否没有 IBOutlet。

您只能通过使用自己的 SearchBar 创建自定义视图控制器来隐藏取消按钮。


推荐阅读