--更新了新发现 -- 在模拟器和设备上进行了测试。当应用程序从冷启动运行时,地图无法正确加载。不显示图块。
mapViewDidFinishLoadingMap
没有被调用。因此,由于地图未完成而出现问题,但我没有收到任何错误。
如果我只是短暂退出应用程序然后再次进入,地图就可以正常加载。这意味着如果从后台打开应用程序,则会加载地图。
有什么想法发生了变化吗?在 iOS 10 中运行得很好。
Update
在 iOS 11 中mapViewWillStartLocatingUser
正在被调用但未被调用mapViewWillStartRenderingMap
。我想知道是否必须手动调用某些内容才能开始渲染地图。在 iOS 9 中(我测试的对象,它是否工作得很好)mapViewWillStartRenderingMap
之前被调用mapViewWillStartLocatingUser
我认为你应该尝试删除
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
}
并将以下代码放入您的 View Didload 方法中
CGFloat edge = 10.0f;
UIImage *gotoUserLocationButtonImage = self.gotoUserLocationButton.imageView.image;
self.gotoUserLocationButton.frame = CGRectMake(edge, edge + self.statusBarHeight, gotoUserLocationButtonImage.size.width, gotoUserLocationButtonImage.size.height);
UIImage *getDirectionsButtonImage = self.getDirectionsButton.imageView.image;
[self.getDirectionsButton setFrame:CGRectMake(CGRectGetMaxX(self.gotoUserLocationButton.frame), edge + self.statusBarHeight, getDirectionsButtonImage.size.width, getDirectionsButtonImage.size.height)];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)