我试图在 iOS 上的 Google map View 顶部显示一个按钮。我正在使用 Xcode 并尝试了以下代码:
let mapView = GMSMapView()
override func loadView(){
view = mapView
do{
if let styleURL = Bundle.main.url(forResource: "style", withExtension: "json"){
mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
}
} catch {
}
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: 45.45, longitude: -73.6)
marker.title = "Montreal"
marker.snippet = "Canada"
marker.map = mapView
onMapReady()
}
加载 map 时我没有看到任何按钮。 这是 Storyboard的样子:
约束条件如下: enter image description here
如何让这个按钮出现?
最佳答案
关于ios - 在谷歌地图 View 上放置按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47614490/