gpt4 book ai didi

ios - 在 Swift 中显示 GoogleMaps View ?

转载 作者:搜寻专家 更新时间:2023-10-30 22:06:58 24 4
gpt4 key购买 nike

我的代码:

var camera = GMSCameraPosition.cameraWithLatitude(currentLocation.latitude, longitude: currentLocation.longitude, zoom: 12) 
//latitude, longitude like :31.230416 and 121.473701.
let map = GMSMapView(frame: CGRectZero)
map.delegate = self
map.camera = camera
self.view = map

工作正常!像这样:

enter image description here

但是当我创建新 View 时:@IBOutlet weak var mapView: UIView!

然后将此行:self.view = map 更改为 self.mapView = map

这对我不起作用,我得到一个空白 View 。

最佳答案

我通过转到我的 View (查看显示 map )修复它,然后将我的 View 类更改为 GMSMapView。 enter image description here

关于ios - 在 Swift 中显示 GoogleMaps View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32431411/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com