一旦我启动应用程序,它应该加载您所在城市的地图。它在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)


发布于 2017-10-21 21:35:50
因此,错误的初始化是错误的。当我应该在viewController中完成时,我确实在viewDidLoad的顶部初始化了地图视图。解决了这个问题。
https://stackoverflow.com/questions/46502350
复制相似问题