【发布时间】:2017-09-30 11:38:59
【问题描述】:
一旦我启动应用程序,它应该会加载您所在城市的地图。它在 IOS 9-10 中运行良好。由于 iOS 11 地图开始出现奇怪的行为。现在,当您启动应用程序时,它会显示黄色地图。如果我单击主页按钮,等待 3-5 秒并返回应用程序,它将显示应有的地图...尝试调试它,更改布局结构,没有任何帮助.. 下面你可以看到打开时的屏幕截图应用第一次和返回主屏幕 5 秒后。
像这样添加到视图中:
mapView.isScrollEnabled = false
mapView.isZoomEnabled = false
mapView.isPitchEnabled = false
mapView.isRotateEnabled = false
mapContainer.addSubview(mapView)
mapView.fillSuperview()
一旦检测到位置,然后像这样设置地图:
let center = CLLocationCoordinate2D(latitude: mapLatitude - 0.004, longitude: mapLongitude)
let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.04, longitudeDelta: 0.04))
self.mapView.setRegion(region, animated: true)
【问题讨论】:
-
你试过iOS模拟器还是设备?
-
@KosukeOgawa 两个
标签: mkmapview ios11 swift4 apple-maps