ios8 – MKMapView在iOS 8或更高版本中不呈现

我在iOS 8.x.x中的MKMapView中遇到问题.应用程序工作正常iOS 7.x.x,但不在iOS 8.x.x中.在设备上,它只显示注释,但没有映射.

我试图强制重置我的设备,但没有运气.

我在info.plist中添加了这两个值,这是iOS 8及以上版本的要求

<key>NSLocationAlwaysUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>

并在我的Viewdidload中添加了这行代码.

// Check for iOS 8. Without this guard the code will crash with "unknown selector" on iOS 7.
    if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
    {
        [self.locationManager requestWhenInUseAuthorization];
        //[self.locationManager requestAlwaysAuthorization];
        self.myMapView.showsUserLocation = YES;
    }

通过在info.plist和上述代码行中添加这两个值,我可以在用户位置的地图上显示用户的位置和注释,但Map是Blank.

类似于这篇文章:
MKMapView showing blank screen in iOS 8

解决方法

在IOS8.3上都有相同的东西,包括sim和设备. 通过运行系统Maps App(它也显示空网格)解决了一分钟,直到它下载地图.之后,我的MKMapView开始渲染正常.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...