- 更新了新发现 - 在模拟器和设备上进行了测试.从冷启动运行应用程序时,无法正确加载地图.瓷砖没有显示.
mapViewDidFinishLoadingMap没有被召唤.因此,地图不能完成会出错,但我没有错误.
如果我只是简单地退出应用程序然后再次进入,地图就可以正常加载.这意味着如果从后台打开应用程序,则会加载地图.
有什么想法有什么变化吗?在iOS 10中工作得很好.
更新
在iOS 11 mapViewWillStartLocatingUser中被调用但不是mapViewWillStartRenderingMap.我想知道是否必须手动调用某些内容才能启动地图渲染.在iOS 9中(我测试的是什么,并且它运行得很好)mapViewWillStartRenderingMap之前被调用过mapViewWillStartLocatingUser
我认为你应该尝试删除
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
}
Run Code Online (Sandbox Code Playgroud)
并将以下代码放入您的 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)];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1551 次 |
| 最近记录: |